A sound's amplitude is attenuated based on the distance between the listener and the sound source position. A piecewise linear curve (defined in terms of pairs of distance and gain scale factor) specifies the gain scale factor slope. The PointSound's location and attenuation distances are defined in the local coordinate system of the node.
Distance Gain Attenuation
Distance elements in this array of Point2f is a monotonically-increasing set of floating point numbers measured from the location of the sound source. Gain scale factors elements in this list of pairs can be any positive floating point numbers. While for most applications this list of gain scale factors will usually be monotonically-decreasing, they do not have to be. If this is not set, no distance gain attenuation is performed (equivalent to using a distance gain of 1.0 for all distances).
getDistanceGainLength method returns the length of the distance gain attenuation arrays. Arrays passed into getDistanceGain methods should all be at least this size.
There are two methods for getDistanceGain, one returning an array of points, the other returning separate arrays for each attenuation component.
|
|