Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::sound::base::PanDirection Class Reference

A class that represents a generic panning direction. More...

#include <omSoundPanDirection.h>

Public Member Functions

 PanDirection ()
 Create a panning which has a directivity and spread of 0 and direction (0,0,-1), straight ahead. More...
 
 PanDirection (const Vector2f &newDirection, Float newDirectivity=Float(0), Float newSpread=Float(0))
 Create a new panning direction with the specified 2D direction vector, directivity, and spread factor. More...
 
 PanDirection (const Vector3f &newDirection, Float newDirectivity=Float(0), Float newSpread=Float(0))
 Create a new panning direction with the specified 3D direction vector, directivity, and spread factor. More...
 
const Vector3f & getDirection () const
 Return a reference to the 3D direction vector for this panning direction object. More...
 
void setDirection (const Vector2f &newDirection)
 Set the 2D direction vector for this panning direction object. More...
 
void setDirection (const Vector3f &newDirection)
 Set the 3D direction vector for this panning direction object. More...
 
Float getDirectivity () const
 Return the directivity for this panning direction object. More...
 
void setDirectivity (Float newDirectivity)
 Set the directivity for this panning direction object. More...
 
Float getSpread () const
 Return the spread for this panning direction object. More...
 
void setSpread (Float newSpread)
 Set the spread for this panning direction object. More...
 

Detailed Description

A class that represents a generic panning direction.

This class contains a 3D vector representing the panning direction, a 'directivity' value that indicates how localized the panning direction is, and a 'spread' value that indicates how spread out the panned sound field is.

The panning direction uses coordinates where the -z axis is the forward direction, the x axis points the right, and the y axis points up. If 2D pan directions are used, the direction is specified as a 2D vector defined as (X,Z) and contains the X and Z components of a 3D direction.

The panning directivity ranges from 0 to 1. A value of 0 indicates that the original channel layout for the source audio is kept intact and the channels are merely rotated around the listener by the pannning direction. A value of 1 indicates that all source audio channels are to be clustered in the panning direction. Values inbetween 0 and 1 cause the source channels to cluster closer towards the panning direction the closer the directivity gets to 1.

The panning spread ranges from 0 to 1 and indicates how far each source audio channel spreads out around the panning sphere. A value of 0 indicates that the sound from each source channel should be as localized as possible, while a value of 1 indicates that the source channels should be spread up to +-180 degrees from the actual source channel position.

Constructor & Destructor Documentation

om::sound::base::PanDirection::PanDirection ( )
inline

Create a panning which has a directivity and spread of 0 and direction (0,0,-1), straight ahead.

om::sound::base::PanDirection::PanDirection ( const Vector2f &  newDirection,
Float  newDirectivity = Float(0),
Float  newSpread = Float(0) 
)
inline

Create a new panning direction with the specified 2D direction vector, directivity, and spread factor.

The 2D vector is specified where X+ = right and Y- = front. This corresponds to the XZ coordinates of a 3D right-handed coordinate system, projected into the listener's local horizontal plane.

om::sound::base::PanDirection::PanDirection ( const Vector3f &  newDirection,
Float  newDirectivity = Float(0),
Float  newSpread = Float(0) 
)
inline

Create a new panning direction with the specified 3D direction vector, directivity, and spread factor.

The 3D vector is specified where X+ = right and Y+ = up and Z- = front. This corresponds to the XYZ coordinates of a 3D right-handed coordinate system, projected into the listener's local horizontal plane.

Member Function Documentation

const Vector3f& om::sound::base::PanDirection::getDirection ( ) const
inline

Return a reference to the 3D direction vector for this panning direction object.

void om::sound::base::PanDirection::setDirection ( const Vector2f &  newDirection)
inline

Set the 2D direction vector for this panning direction object.

The 2D vector is specified where X+ = right and Y- = front. This corresponds to the XZ coordinates of a 3D right-handed coordinate system, projected into the listener's local horizontal plane.

void om::sound::base::PanDirection::setDirection ( const Vector3f &  newDirection)
inline

Set the 3D direction vector for this panning direction object.

The 3D vector is specified where X+ = right and Y+ = up and Z- = front. This corresponds to the XYZ coordinates of a 3D right-handed coordinate system, projected into the listener's local horizontal plane.

Float om::sound::base::PanDirection::getDirectivity ( ) const
inline

Return the directivity for this panning direction object.

void om::sound::base::PanDirection::setDirectivity ( Float  newDirectivity)
inline

Set the directivity for this panning direction object.

The new directivity value is clamped to the range [0,1].

Float om::sound::base::PanDirection::getSpread ( ) const
inline

Return the spread for this panning direction object.

void om::sound::base::PanDirection::setSpread ( Float  newSpread)
inline

Set the spread for this panning direction object.

The new spread value is clamped to the range [0,1].


The documentation for this class was generated from the following file: