carb::audio::RolloffCurve

Defined in carb/audio/IAudioPlayback.h

struct RolloffCurve

defines the point-wise curve that is used for specifying custom rolloff curves.

This curve is defined as a set of points that are treated as a piece-wise curve where each point’s X value represents the listener’s normalized distance from the emitter, and the Y value represents the DSP value at that distance. A linear interpolation is done between points on the curve. Any distances beyond the X value on the last point on the curve simply use the DSP value for the last point. Similarly, and distances closer than the first point simply use the first point’s DSP value. This curve should always be normalized such that the first point is at a distance of 0.0 (maps to the emitter’s ‘near’ distance) and the last point is at a distance of 1.0 (maps to the emitter’s ‘far’ distance). The interpretation of the specific DSP values at each point depends on the particular usage of the curve. If used, this must contain at least one point.

Public Members

size_t pointCount

the total number of points on the curve.

This is the total number of entries in the points table. This must be greater than zero.

Float2 *points

the table of data points in the curve.

Each point’s X value represents a normalized distance from the emitter to the listener. Each point’s Y value is the corresponding DSP value to be interpolated at that distance. The points in this table must be sorted in increasing order of distance. No two points on the curve may have the same distance value. Failure to meet these requirements will result in undefined behavior.