Enum Class DistanceAttenuationModel

java.lang.Object
java.lang.Enum<DistanceAttenuationModel>
de.pottgames.tuningfork.DistanceAttenuationModel
All Implemented Interfaces:
Serializable, Comparable<DistanceAttenuationModel>, Constable

public enum DistanceAttenuationModel extends Enum<DistanceAttenuationModel>
An enum that holds a list of available attenuation models.
See Also:
  • Enum Constant Details

    • NONE

      public static final DistanceAttenuationModel NONE
      Turns the distance attenuation off.
    • INVERSE_DISTANCE

      public static final DistanceAttenuationModel INVERSE_DISTANCE
      This text is taken from the official OpenAL documentation. You may want to take a look at it.

      Inverse distance rolloff model, which is equivalent to the IASIG I3DL2 model with the exception that referenceDistance does not imply any clamping. gain = referenceDistance / (referenceDistance + rolloffFactor * (distance - referenceDistance))
      The referenceDistance parameter used here is a per-source attribute which is the distance at which the listener will experience gain (unless the implementation had to clamp effective gain to the available dynamic range). rolloffFactor is per-source parameter the application can use to increase or decrease the range of a source by decreasing or increasing the attenuation, respectively. The default value is 1. The implementation is free to optimize for a rolloffFactor value of 0, which indicates that the application does not wish any distance attenuation on the respective source.
    • INVERSE_DISTANCE_CLAMPED

      public static final DistanceAttenuationModel INVERSE_DISTANCE_CLAMPED
      This text is taken from the official OpenAL documentation. You may want to take a look at it.

      This is the Inverse Distance Rolloff Model model, extended to guarantee that for distances below AL_REFERENCE_DISTANCE, gain is clamped. This mode is equivalent to the IASIG I3DL2 distance model. distance = max(distance,AL_REFERENCE_DISTANCE); distance = min (distance,AL_MAX_DISTANCE); gain = AL_REFERENCE_DISTANCE / (AL_REFERENCE_DISTANCE + AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE));
    • LINEAR_DISTANCE

      public static final DistanceAttenuationModel LINEAR_DISTANCE
      This text is taken from the official OpenAL documentation. You may want to take a look at it.

      This models a linear drop-off in gain as distance increases between the source and listener. distance = min (distance, AL_MAX_DISTANCE) // avoid negative gain gain = (1 – AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE) / (AL_MAX_DISTANCE – AL_REFERENCE_DISTANCE))
    • LINEAR_DISTANCE_CLAMPED

      public static final DistanceAttenuationModel LINEAR_DISTANCE_CLAMPED
      This text is taken from the official OpenAL documentation. You may want to take a look at it.

      This is the linear model, extended to guarantee that for distances below AL_REFERENCE_DISTANCE, gain is clamped. distance = max(distance, AL_REFERENCE_DISTANCE) distance = min(distance, AL_MAX_DISTANCE) gain = (1 – AL_ROLLOFF_FACTOR * (distance – AL_REFERENCE_DISTANCE) / (AL_MAX_DISTANCE – AL_REFERENCE_DISTANCE))
    • EXPONENT_DISTANCE

      public static final DistanceAttenuationModel EXPONENT_DISTANCE
      This text is taken from the official OpenAL documentation. You may want to take a look at it.

      This models an exponential dropoff in gain as distance increases between the source and listener. gain = (distance / AL_REFERENCE_DISTANCE) ^ (- AL_ROLLOFF_FACTOR) where the ^ operation raises its first operand to the power of its second operand.
    • EXPONENT_DISTANCE_CLAMPED

      public static final DistanceAttenuationModel EXPONENT_DISTANCE_CLAMPED
      This text is taken from the official OpenAL documentation. You may want to take a look at it.

      This is the exponential model, extended to guarantee that for distances below AL_REFERENCE_DISTANCE, gain is clamped. distance = max(distance, AL_REFERENCE_DISTANCE) distance = min(distance, AL_MAX_DISTANCE) gain = (distance / AL_REFERENCE_DISTANCE) ^ (- AL_ROLLOFF_FACTOR)
  • Method Details

    • values

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

      public static DistanceAttenuationModel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null