#include <listener.h>

Public Member Functions | |
| virtual void | SetVelocity (const osg::Vec3 &velocity)=0L |
| Set the velocity of the listener. | |
| virtual void | GetVelocity (osg::Vec3 &velocity) const =0L |
| Get the velocity of the listener. | |
| virtual void | SetGain (float gain)=0L |
| Sets the master volume of the listener. | |
| virtual float | GetGain () const =0L |
| Returns the master volume of the listener. | |
Protected Member Functions | |
| Listener () | |
| Constructor, user does not create directly instead requests the listener from AudioManager. | |
| virtual | ~Listener () |
| Destructor, user does not delete directly AudioManager handles destruction. | |
dtAudio::Listener is just an interface to the global listener object held within (and protected) by the dtAudio::AudioManager.
The listener is not created directly by the user (new/delete). Instead the user requests the listener from the AudioManager:
Listener* global_ear = AudioManager::GetManager()->GetListener();
The user can then call any of the Listener interface functions. After the user is finished with the Listener, there is no need to free it up. The underlying listener object is a global singular which lasts as long as the AudioManager exists.
Listener is a transformable, so it can be a child of other transformables (ie. the camera) When a Listener is child of another object, it automatically gets positioned in scene-space relative to the parent object every frame, so there is no need to update the Listener's position. The Listener position can be set manually in scene-space without having to make it a child of another object, but any position updates must then be made manually.
| Listener::Listener | ( | ) | [protected] |
Constructor, user does not create directly instead requests the listener from AudioManager.
| Listener::~Listener | ( | ) | [protected, virtual] |
Destructor, user does not delete directly AudioManager handles destruction.
| virtual void dtAudio::Listener::SetVelocity | ( | const osg::Vec3 & | velocity | ) | [pure virtual] |
Set the velocity of the listener.
| velocity | to set |
| virtual void dtAudio::Listener::GetVelocity | ( | osg::Vec3 & | velocity | ) | const [pure virtual] |
Get the velocity of the listener.
| velocity | to get |
| virtual void dtAudio::Listener::SetGain | ( | float | gain | ) | [pure virtual] |
Sets the master volume of the listener.
| gain | the new gain |
| virtual float dtAudio::Listener::GetGain | ( | ) | const [pure virtual] |
Returns the master volume of the listener.