cAudio 2.3.0
3d Audio Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
cAudio::cListener Class Reference
Inheritance diagram for cAudio::cListener:
Inheritance graph
[legend]
Collaboration diagram for cAudio::cListener:
Collaboration graph
[legend]

Public Member Functions

virtual void setPosition (const cVector3 &pos)
 Sets the position of the listener.
 
virtual void setDirection (const cVector3 &dir)
 Sets the direction the listener is facing.
 
virtual void setUpVector (const cVector3 &up)
 Sets the up vector to use for the listener.
 
virtual void setVelocity (const cVector3 &vel)
 Sets the current velocity of the listener for doppler effects.
 
virtual void setMasterVolume (const float &volume)
 Sets the global volume modifier (will effect all sources)
 
virtual void move (const cVector3 &pos)
 Convenience function to automatically set the velocity and position for you in a single call.
 
virtual cVector3 getPosition (void) const
 Returns the current position of the listener.
 
virtual cVector3 getDirection (void) const
 Returns the current direction of the listener.
 
virtual cVector3 getUpVector (void) const
 Returns the current up vector of the listener.
 
virtual cVector3 getVelocity (void) const
 Returns the current velocity of the listener.
 
virtual float getMasterVolume (void) const
 Returns the global volume modifier for all sources.
 
virtual void setPosition (const cVector3 &pos)=0
 Sets the position of the listener.
 
virtual void setDirection (const cVector3 &dir)=0
 Sets the direction the listener is facing.
 
virtual void setUpVector (const cVector3 &up)=0
 Sets the up vector to use for the listener.
 
virtual void setVelocity (const cVector3 &vel)=0
 Sets the current velocity of the listener for doppler effects.
 
virtual void setMasterVolume (const float &volume)=0
 Sets the global volume modifier (will effect all sources)
 
virtual void move (const cVector3 &pos)=0
 Convenience function to automatically set the velocity and position for you in a single call.
 
virtual cVector3 getPosition (void) const =0
 Returns the current position of the listener.
 
virtual cVector3 getDirection (void) const =0
 Returns the current direction of the listener.
 
virtual cVector3 getUpVector (void) const =0
 Returns the current up vector of the listener.
 
virtual cVector3 getVelocity (void) const =0
 Returns the current velocity of the listener.
 
virtual float getMasterVolume (void) const =0
 Returns the global volume modifier for all sources.
 

Protected Attributes

cAudioMutex Mutex
 
cVector3 Position
 
cVector3 Direction
 
cVector3 UpVector
 
cVector3 Velocity
 
float MasterGain
 

Detailed Description

Definition at line 12 of file cListener.h.

Constructor & Destructor Documentation

◆ cListener()

cAudio::cListener::cListener ( )
inline

Definition at line 15 of file cListener.h.

◆ ~cListener()

virtual cAudio::cListener::~cListener ( )
inlinevirtual

Definition at line 18 of file cListener.h.

Member Function Documentation

◆ getDirection()

virtual cVector3 cAudio::cListener::getDirection ( void  ) const
inlinevirtual

Returns the current direction of the listener.

Implements cAudio::IListener.

Definition at line 28 of file cListener.h.

◆ getMasterVolume()

virtual float cAudio::cListener::getMasterVolume ( void  ) const
inlinevirtual

Returns the global volume modifier for all sources.

Implements cAudio::IListener.

Definition at line 31 of file cListener.h.

◆ getPosition()

virtual cVector3 cAudio::cListener::getPosition ( void  ) const
inlinevirtual

Returns the current position of the listener.

Implements cAudio::IListener.

Definition at line 27 of file cListener.h.

◆ getUpVector()

virtual cVector3 cAudio::cListener::getUpVector ( void  ) const
inlinevirtual

Returns the current up vector of the listener.

Implements cAudio::IListener.

Definition at line 29 of file cListener.h.

◆ getVelocity()

virtual cVector3 cAudio::cListener::getVelocity ( void  ) const
inlinevirtual

Returns the current velocity of the listener.

Implements cAudio::IListener.

Definition at line 30 of file cListener.h.

◆ move()

void cAudio::cListener::move ( const cVector3 pos)
virtual

Convenience function to automatically set the velocity and position for you in a single call.

Velocity will be set to new position - last position

Parameters
posNew position to move the listener to.

Implements cAudio::IListener.

Definition at line 48 of file cListener.cpp.

◆ setDirection()

void cAudio::cListener::setDirection ( const cVector3 dir)
virtual

Sets the direction the listener is facing.

Parameters
dirNew direction vector for the listener.

Implements cAudio::IListener.

Definition at line 18 of file cListener.cpp.

◆ setMasterVolume()

void cAudio::cListener::setMasterVolume ( const float &  volume)
virtual

Sets the global volume modifier (will effect all sources)

Parameters
volumeVolume to scale all sources by. Range: 0.0 to +inf.

Implements cAudio::IListener.

Definition at line 41 of file cListener.cpp.

◆ setPosition()

void cAudio::cListener::setPosition ( const cVector3 pos)
virtual

Sets the position of the listener.

Note that you will still have to set velocity after this call for proper doppler effects. Use move() if you'd like to have cAudio automatically handle velocity for you.

Parameters
posNew position for the listener.

Implements cAudio::IListener.

Definition at line 11 of file cListener.cpp.

◆ setUpVector()

void cAudio::cListener::setUpVector ( const cVector3 up)
virtual

Sets the up vector to use for the listener.

Default up vector is Y+, same as OpenGL.

Parameters
upNew up vector for the listener.

Implements cAudio::IListener.

Definition at line 26 of file cListener.cpp.

◆ setVelocity()

void cAudio::cListener::setVelocity ( const cVector3 vel)
virtual

Sets the current velocity of the listener for doppler effects.

Parameters
velNew velocity for the listener.

Implements cAudio::IListener.

Definition at line 34 of file cListener.cpp.

Member Data Documentation

◆ Direction

cVector3 cAudio::cListener::Direction
protected

Definition at line 42 of file cListener.h.

◆ MasterGain

float cAudio::cListener::MasterGain
protected

Definition at line 45 of file cListener.h.

◆ Mutex

cAudioMutex cAudio::cListener::Mutex
protected

Definition at line 39 of file cListener.h.

◆ Position

cVector3 cAudio::cListener::Position
protected

Definition at line 41 of file cListener.h.

◆ UpVector

cVector3 cAudio::cListener::UpVector
protected

Definition at line 43 of file cListener.h.

◆ Velocity

cVector3 cAudio::cListener::Velocity
protected

Definition at line 44 of file cListener.h.


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