|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions
gameplay::AudioListener Class Reference

`#include <AudioListener.h>`

Inheritance diagram for gameplay::AudioListener:

List of all members.

## Public Member Functions

const Vector3 & | getPosition () const
void | setPosition (const Vector3 &position)
void | setPosition (float x, float y, float z)
float | getGain () const
void | setGain (float gain)
const Vector3 & | getVelocity () const
void | setVelocity (const Vector3 &velocity)
void | setVelocity (float x, float y, float z)
const float * | getOrientation () const
const Vector3 & | getOrientationForward () const
const Vector3 & | getOrientationUp () const
void | setOrientation (const Vector3 &forward, const Vector3 &up)
void | setOrientation (float forwardX, float forwardY, float forwardZ, float upX, float upY, float upZ)
Camera * | getCamera () const
void | setCamera (Camera *camera)

## Static Public Member Functions

static AudioListener * | getInstance ()

## Detailed Description

Defines an audio listener in 3D space.

The audio listener represents where you are listening from. In a 3D scene this is usually the active camera.

See also:
  Scene::bindAudioListenerToCamera

## Member Function Documentation

Camera* gameplay::AudioListener::getCamera | ( |  | ) | const

Gets the camera currently associated with the audio listener.

Returns:
  camera The camera currently associated with the audio listener.

float gameplay::AudioListener::getGain | ( |  | ) | const

Returns the gain of the audio listener.

Returns:
  The gain of the audio listener.

static AudioListener* gameplay::AudioListener::getInstance | ( |  | ) | `[static]`

Gets the single instance of the audio listener.

Returns:
  The single instance of the audio listener.

const float* gameplay::AudioListener::getOrientation | ( |  | ) | const

Gets the float pointer to the orientation of the audio listener. Orientation is represented as 6 floats. (forward.x, forward.y, forward.z, up.x, up.y, up.z).

Returns:
  Pointer to the 6 orientation float values.

const Vector3& gameplay::AudioListener::getOrientationForward | ( |  | ) | const

Gets the forward orientation vector of the audio listener.

Returns:
  The forward vector.

const Vector3& gameplay::AudioListener::getOrientationUp | ( |  | ) | const

Gets the up orientation vector of the audio listener.

Returns:
  The up vector.

const Vector3& gameplay::AudioListener::getPosition | ( |  | ) | const

Gets the current position of the audio listener.

Returns:
  The position of the audio listener

const Vector3& gameplay::AudioListener::getVelocity | ( |  | ) | const

Gets the velocity of the audio source.

Returns:
  The velocity as a vector.

void gameplay::AudioListener::setCamera | ( | Camera * | camera | ) |

Sets the camera that is associated with the audio listener. This should usually be the current camera.

Parameters:

  camera | The camera that is associated with the audio listener

void gameplay::AudioListener::setGain | ( | float | gain | ) |

Sets the gain/volume of the audio listener.

Parameters:

  gain | The gain/volume of the listener.

void gameplay::AudioListener::setOrientation | ( | const Vector3 & | forward,
|  | const Vector3 & | up
| ) |  |

Sets the orientation of the audio listener.

Parameters:

  forward | The forward vector.
  up | The up vector.

void gameplay::AudioListener::setOrientation | ( | float | forwardX,
|  | float | forwardY,
|  | float | forwardZ,
|  | float | upX,
|  | float | upY,
|  | float | upZ
| ) |  |

Sets the orientation of the audio listener.

Parameters:

  forwardX | The x coordinate of the forward vector.
  forwardY | The y coordinate of the forward vector.
  forwardZ | The z coordinate of the forward vector.
  upX | The x coordinate of the up vector.
  upY | The y coordinate of the up vector.
  upZ | The z coordinate of the up vector.

void gameplay::AudioListener::setPosition | ( | const Vector3 & | position | ) |

Sets the position of the audio source.

Parameters:

  position | The position to set the listener to.

void gameplay::AudioListener::setPosition | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

Sets the position of the audio source.

Parameters:

  x | The x coordinate of the position.
  y | The y coordinate of the position.
  z | The z coordinate of the position.

void gameplay::AudioListener::setVelocity | ( | const Vector3 & | velocity | ) |

Sets the velocity of the audio source

Parameters:

  velocity | A vector representing the velocity.

void gameplay::AudioListener::setVelocity | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

Sets the velocity of the audio source

Parameters:

  x | The x coordinate of the velocity.
  y | The y coordinate of the velocity.
  z | The z coordinate of the velocity.

All Classes Functions Variables Typedefs Enumerations Enumerator