carb::audio::EmitterAttributes

Defined in carb/audio/IAudioPlayback.h

struct EmitterAttributes : public carb::audio::EntityAttributes

spatial attributes of an emitter entity.

Public Members

RolloffDesc rolloff

a descriptor of the rolloff parameters for this emitter.

This is valid and accessed only if the fEntityFlagRolloff flag is set in EntityAttributes::flags. The curves (if any) in this descriptor must remain valid for the entire time a voice is playing the sound represented by this emitter.

void *ext = nullptr

provides an extended information block.

This is reserved for future expansion and must be set to nullptr. The values in flags may be used to indicate how this value should be interpreted.

EntityAttributeFlags flags

a set of flags that indicate which of members of this struct are valid.

This may be fEntityFlagAll to indicate that all members contain valid data.

Float3 position

the current position of the listener in world units.

This should only be expressed in meters if the world units scale is set to 1.0 for this context. This value is ignored if the fEntityFlagPosition flag is not set in flags.

Float3 velocity

the current velocity of the listener in world units per second.

This should only be expressed in meters per second if the world units scale is set to 1.0 with for the context. The magnitude of this vector will be taken as the listener’s current speed and the vector’s direction will indicate the listener’s current direction. This vector should not be normalized unless the listener’s speed is actually 1.0 units per second. This may be a zero vector if the listener is not moving. This value is ignored if the fEntityFlagVelocity flag is not set in flags. This vector will not be modified in any way before use.

Float3 forward

a vector indicating the direction the listener is currently facing.

This does not need to be normalized, but should be for simplicity. If the fEntityFlagNormalize flag is set in flags, this vector will be normalized internally before being used. This vector should be perpendicular to the up vector unless the fEntityFlagMakePerp flag is set in flags. This must not be a zero vector unless the fEntityFlagForward flag is not set in flags.

Float3 up

a vector indicating the upward direction for the listener.

This does not need to be normalized, but should be for simplicity. If the fEntityFlagNormalize flag is set in flags, this vector will be normalized internally before being used. This vector should be perpendicular to the forward vector unless the fEntityFlagMakePerp flag is set in flags. This must not be a zero vector unless the fEntityFlagUp flag is not set in flags.

EntityCone cone

defines an optional sound cone for an entity.

The cone is a segment of a sphere around the entity’s position opening up toward its front vector. The cone is defined by an inner and outer angle, and several DSP values to be interpolated between for those two endpoint angles. This cone is valid if the fEntityFlagCone flag is set in flags.