Enum DistanceModelType

java.lang.Object
java.lang.Enum<DistanceModelType>
com.codename1.media.audio.DistanceModelType
All Implemented Interfaces:
Comparable<DistanceModelType>

public enum DistanceModelType extends Enum<DistanceModelType>
How a PannerNode attenuates a source with distance, using its refDistance, maxDistance and rolloffFactor.
  • Enum Constant Details

    • LINEAR

      public static final DistanceModelType LINEAR
      1 - rolloff * (d - ref) / (max - ref), with d clamped to [ref, max] and the rolloff to [0, 1].
    • INVERSE

      public static final DistanceModelType INVERSE
      ref / (ref + rolloff * (d - ref)), with d at least ref. The default.
    • EXPONENTIAL

      public static final DistanceModelType EXPONENTIAL
      (d / ref) ^ -rolloff, with d at least ref.
  • Method Details

    • values

      public static DistanceModelType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DistanceModelType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null