Planeshift
|
This object represents a planeshift soundEmitter. More...
#include <psemitter.h>
Public Member Functions | |
bool | CheckRange (csVector3 listenerPos) |
Check range to the given position. | |
bool | CheckTimeOfDay (int time) |
Check time of day. | |
bool | Play (SoundControl *&ctrl) |
Play this emitter. | |
psEmitter () | |
Constructor. | |
psEmitter (psEmitter *const &emitter) | |
Copy Constructor copies resource volume range and time parameters everything else remains uninitialized! | |
void | Stop () |
Stops this emitter. | |
~psEmitter () | |
Destructor Removes our Callback from the Handle if its still playing. | |
Static Public Member Functions | |
static void | StopCallback (void *object) |
Callback function for Stop. | |
Public Attributes | |
bool | active |
is this emitter active? | |
csVector3 | direction |
direction were emitting to | |
bool | dopplerEffect |
true if the doppler effect must be applied for this emitter | |
csString | factory |
name of the factory this emitter should attach to | |
float | factory_prob |
probability that this emitter attaches to the factory | |
int | fadedelay |
how long fading should take in milliseconds | |
SoundHandle * | handle |
bool | loop |
true if the sound if the sound has to loop | |
float | maxrange |
range when it should have minvol | |
float | maxvol |
vol at minrange | |
float | minrange |
range when it should reach maxvol | |
float | minvol |
vol at maxrange | |
csVector3 | position |
position of the emitter | |
float | probability |
probability that this emitter play the sound | |
csString | resource |
name of the resource | |
int | timeofday |
time when this emitter starts playing | |
int | timeofdayrange |
time when this emitter stops |
This object represents a planeshift soundEmitter.
Everything is in this object public and you can modify it at any time. Make sure that you call Stop and Play after doing that. Keep in mind that you have to be carefull when changing the SoundHandle and its "active" status.
Definition at line 36 of file psemitter.h.
psEmitter::psEmitter | ( | ) |
Constructor.
psEmitter::~psEmitter | ( | ) |
Destructor Removes our Callback from the Handle if its still playing.
psEmitter::psEmitter | ( | psEmitter *const & | emitter | ) |
Copy Constructor copies resource volume range and time parameters everything else remains uninitialized!
emitter | a existing emitter |
bool psEmitter::CheckRange | ( | csVector3 | listenerPos | ) |
Check range to the given position.
Calculates the distance to the given position and returns true if this emitter is in range.
listenerPos | position used for calculation |
bool psEmitter::CheckTimeOfDay | ( | int | time | ) |
Check time of day.
Checks if time is within this emitters timewindow. Returns true if it is.
time | <24 && >0 is resonable but can be any valid int |
bool psEmitter::Play | ( | SoundControl *& | ctrl | ) |
Play this emitter.
Makes this emitter play - you need to provide a SoundControl.
ctrl | SoundControl for this emitter |
void psEmitter::Stop | ( | ) |
Stops this emitter.
static void psEmitter::StopCallback | ( | void * | object | ) | [static] |
Callback function for Stop.
SoundHandles callback will point to this and inform us if it gets destroyed. It sets active to false and Handle to NULL
bool psEmitter::active |
is this emitter active?
Definition at line 51 of file psemitter.h.
csVector3 psEmitter::direction |
direction were emitting to
Definition at line 50 of file psemitter.h.
true if the doppler effect must be applied for this emitter
Definition at line 52 of file psemitter.h.
csString psEmitter::factory |
name of the factory this emitter should attach to
Definition at line 46 of file psemitter.h.
probability that this emitter attaches to the factory
Definition at line 47 of file psemitter.h.
how long fading should take in milliseconds
Definition at line 42 of file psemitter.h.
Definition at line 55 of file psemitter.h.
bool psEmitter::loop |
true if the sound if the sound has to loop
Definition at line 48 of file psemitter.h.
range when it should have minvol
Definition at line 44 of file psemitter.h.
vol at minrange
Definition at line 41 of file psemitter.h.
range when it should reach maxvol
Definition at line 43 of file psemitter.h.
vol at maxrange
Definition at line 40 of file psemitter.h.
csVector3 psEmitter::position |
position of the emitter
Definition at line 49 of file psemitter.h.
probability that this emitter play the sound
Definition at line 45 of file psemitter.h.
csString psEmitter::resource |
name of the resource
Definition at line 39 of file psemitter.h.
time when this emitter starts playing
Definition at line 53 of file psemitter.h.
time when this emitter stops
Definition at line 54 of file psemitter.h.