SummaryA DistanceModel converts a distance (e.g. to the virtual listener) to a gain value.
RemarksIt is implemented as a piece-wise linear curve defined by three points
C, and the maxDistance property. For distances beyond maxDistance the gain will be -inf (silent).
The first point
Anot only defines its sampled point on the (distance, gain) graph, but also the level for distances smaller than
A's distance. In other words, distances below
Awill have the same gain as
The graph will look something like
GAIN in decibels ^ | |___A | \ | \___C | B \ | \ | \ |-----------\---> DISTANCE maxDist
Do not construct a DistanceModel instance yourself, it will be provided by the spatial audio engine.
Optional name of the DistanceModel.
RemarksThis can be used to identify the DistanceModel.
Returns the parameters of the attenuation curve.
DistanceModelDataPointsobject holding the parameters
Updates the parameters of this DistanceModel.
setDataPoints(A: DistanceModelDataPoint, B: DistanceModelDataPoint, C: DistanceModelDataPoint, maxDistance: number)
Make sure the following holds: maxDistance >= A.distance >= B.distance >= C.distance