carb::audio::EntityCone
Defined in carb/audio/IAudioPlayback.h
-
struct EntityCone
defines a sound cone relative to an entity’s front vector.
It is defined by two angles - the inner and outer angles. When the angle between an emitter and the listener (relative to the entity’s front vector) is smaller than the inner angle, the resulting DSP value will be the ‘inner’ value. When the emitter-listener angle is larger than the outer angle, the resulting DSP value will be the ‘outer’ value. For emitter-listener angles that are between the inner and outer angles, the DSP value will be interpolated between the inner and outer angles. If a cone is valid for an entity, the fEntityFlagCone flag should be set in EntityAttributes::flags.
Note that a cone’s effect on the spatial volume of a sound is purely related to the angle between the emitter and listener. Any distance attenuation is handled separately.
Public Members
-
float insideAngle
the inside angle of the entity’s sound cone in radians.
This describes the angle around the entity’s forward vector within which the entity’s DSP values will always use their ‘inner’ values. This angle will extend half way in all directions around the forward vector. For example, a 30 degree (as converted to radians to store here) inside angle will extend 15 degrees in all directions around the forward vector. Set this to kConeAngleOmnidirectional to define an omni-directional entity. This must be greater than or equal to 0 and less than or equal to outsideAngle.
-
float outsideAngle
the outside angle of the entity’s sound cone in radians.
This describes the angle around the entity’s forward vector up to which the volume will be interpolated. When the emitter-listener angle is larger than this angle, the ‘outer’ DSP values will always be used. This angle will extend half way in all directions around the forward vector. For example, a 30 degree (as converted to radians to store here) inside angle will extend 15 degrees in all directions around the forward vector. Set this to kConeAngleOmnidirectional to define an omni-directional entity. This must be greater than or equal to insideAngle.
-
DspValuePair volume
the volumes to use for emitter-listener lines that are inside and outside the entity’s cone angles.
These will be used as the endpoint values to interpolate to for angles between the inner and outer angles, and for the values for all angles outside the cone’s inner and outer angles. These should be in the range 0.0 (silence) to 1.0 (full volume).
-
DspValuePair lowPassFilter
the low pass filter parameter values to use for emitter-listener lines that are inside and outside the entity’s cone angles.
These will be used as the endpoint values to interpolate to for angles between the inner and outer angles, and for the values for all angles outside the cone’s inner and outer angles. There is no specific range for these values other than what is commonly accepted for low pass filter parameters. This multiplies by member
direct
of VoiceParams::occlusion, if that is set to anything other than 1.0. Setting this to a value outside of [0.0, 1.0] will result in an undefined low pass filter value being used.
-
DspValuePair reverb
the reverb mix level values to use for emitter-listener lines that are inside and outside the entity’s cone angles.
These will be used as the endpoint values to interpolate to for angles between the inner and outer angles, and for the values for all angles outside the cone’s inner and outer angles. This should be in the range 0.0 (no reverb) to 1.0 (full reverb).
-
void *ext = nullptr
reserved for future expansion.
This must be nullptr.
-
float insideAngle