Sound source management. More...
#include <TorcsSound.h>
Public Member Functions | |
| SoundSource () | |
| Create a sound source. More... | |
| void | update () |
| Calculate environmental parameters for current situation. More... | |
| void | setSource (sgVec3 p, sgVec3 u) |
| Set source position and velocity. More... | |
| void | setListener (sgVec3 p, sgVec3 u) |
| Set listener position and velocity. More... | |
Public Attributes | |
| sgVec3 | p_lis |
| listener position for this source More... | |
| sgVec3 | u_lis |
| listener velocity for this source More... | |
| sgVec3 | p_src |
| source position More... | |
| sgVec3 | u_src |
| source velocity; More... | |
| float | a |
| Environmental attenuation. More... | |
| float | f |
| Environmental frequency shift. More... | |
| float | lp |
| Environmental filtering. More... | |
Sound source management.
The sound source is different from the sound itself. It should describe the position, speed, environment and other aspects of the sound's source. Each sound source can emit many different actual sounds.
Since sources can be coupled to particular listeners, it is in principle possible to implement multiple listeners, something which should be extremely useful for same-computer multiplayer games.
Definition at line 141 of file TorcsSound.h.
| SoundSource::SoundSource | ( | ) |
Create a sound source.
Definition at line 189 of file TorcsSound.cpp.
| void SoundSource::setListener | ( | sgVec3 | p, |
| sgVec3 | u | ||
| ) |
Set listener position and velocity.
Definition at line 272 of file TorcsSound.cpp.
| void SoundSource::setSource | ( | sgVec3 | p, |
| sgVec3 | u | ||
| ) |
Set source position and velocity.
Definition at line 262 of file TorcsSound.cpp.
| void SoundSource::update | ( | ) |
Calculate environmental parameters for current situation.
At the moment this
Definition at line 201 of file TorcsSound.cpp.
| float SoundSource::a |
Environmental attenuation.
Definition at line 147 of file TorcsSound.h.
| float SoundSource::f |
Environmental frequency shift.
Definition at line 148 of file TorcsSound.h.
| float SoundSource::lp |
Environmental filtering.
Definition at line 149 of file TorcsSound.h.
| sgVec3 SoundSource::p_lis |
listener position for this source
Definition at line 143 of file TorcsSound.h.
| sgVec3 SoundSource::p_src |
source position
Definition at line 145 of file TorcsSound.h.
| sgVec3 SoundSource::u_lis |
listener velocity for this source
Definition at line 144 of file TorcsSound.h.
| sgVec3 SoundSource::u_src |
source velocity;
Definition at line 146 of file TorcsSound.h.