carb::audio::SpeakerDirection

Defined in carb/audio/IAudioPlayback.h

struct SpeakerDirection

specifies the relative direction to a single speaker.

This is effectively a 3-space vector, but is explicitly described here to avoid any confusion between various common coordinate systems (ie: graphics systems take Z as pointing in the direction of the camera whereas audio systems take Z as pointing up).

This direction vector is always taken to be relative to the [real biological] user’s expected position within the [physical] speaker setup where the origin is the user’s position and the coordinates in each direction range from -1.0 to 1.0. The provided vector does not need to be normalized.

Public Members

float leftRight = 0.0f

the left-to-right coordinate.

A value of 0.0 is in line with the user’s gaze. A value of -1.0 puts the speaker fully on the user’s left side. A value of 1.0 puts the speaker fully on the user’s right side.

float frontBack = 0.0f

the front-to-back coordinate.

A value of 0.0 is in line with the user’s ears. A value of -1.0 puts the speaker fully behind the user. A value of 1.0 puts the speaker fully in front of the user.

float topBottom = 0.0f

the top-to-bottom coordinate.

A value of 0.0 is on the plane formed from the user’s ears and gaze. A value of -1.0 puts the speaker fully below the user. A value of 1.0 puts the speaker fully above the user.