TORCS  1.3.9
The Open Racing Car Simulator
SoundSource Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SoundSource()

SoundSource::SoundSource ( )

Create a sound source.

Definition at line 189 of file TorcsSound.cpp.

Member Function Documentation

◆ setListener()

void SoundSource::setListener ( sgVec3  p,
sgVec3  u 
)

Set listener position and velocity.

Definition at line 272 of file TorcsSound.cpp.

◆ setSource()

void SoundSource::setSource ( sgVec3  p,
sgVec3  u 
)

Set source position and velocity.

Definition at line 262 of file TorcsSound.cpp.

◆ update()

void SoundSource::update ( )

Calculate environmental parameters for current situation.

At the moment this

Definition at line 201 of file TorcsSound.cpp.

Member Data Documentation

◆ a

float SoundSource::a

Environmental attenuation.

Definition at line 147 of file TorcsSound.h.

◆ f

float SoundSource::f

Environmental frequency shift.

Definition at line 148 of file TorcsSound.h.

◆ lp

float SoundSource::lp

Environmental filtering.

Definition at line 149 of file TorcsSound.h.

◆ p_lis

sgVec3 SoundSource::p_lis

listener position for this source

Definition at line 143 of file TorcsSound.h.

◆ p_src

sgVec3 SoundSource::p_src

source position

Definition at line 145 of file TorcsSound.h.

◆ u_lis

sgVec3 SoundSource::u_lis

listener velocity for this source

Definition at line 144 of file TorcsSound.h.

◆ u_src

sgVec3 SoundSource::u_src

source velocity;

Definition at line 146 of file TorcsSound.h.


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