30 #define DEFAULT_ENTITY_STATE 0 31 #define UNDEFINED_ENTITY_STATE -1 48 psEntity(
bool isFactoryEntity,
const char* entityName);
70 return isFactoryEntity;
109 void SetRange(
float minRange,
float maxRange);
180 bool CanPlay(
int time,
float range)
const;
202 void SetState(
int state,
bool forceChange,
bool setReady);
231 csVector3 entityPosition);
239 csStringArray resources;
247 float fallbackProbability;
254 bool isFactoryEntity;
265 csHash<EntityState*, uint> states;
271 static void StopCallback(
void*
object);
const csString & GetEntityName() const
Gets the entity name associated to this object.
bool IsPlaying() const
Check if the sound associated to this entity is still working.
int GetState()
Gets the state of the entity.
bool CanPlay(int time, float range) const
Checks if all condition for the sound to play are satisfied in the current state. ...
bool IsActive() const
Check if this entity is active.
void SetRange(float minRange, float maxRange)
Sets the range for this entity.
void Stop()
If this entity is playing, this method forces this to stop the sound.
void SetMeshID(uint id)
Set the ID of the mesh associated to this entity.
void SetAsMeshEntity(const char *meshName)
Sets this object as a mesh entity.
bool IsTemporary() const
Used to determine if this is a temporary entity associated to a specific mesh object or if it is a fa...
bool Play(SoundControl *&ctrl, csVector3 entityPosition)
Force this entity to play the sound associated to its current state.
psEntity(bool isFactoryEntity, const char *entityName)
Create a new psEntity.
A Volume and Sound control class.
float GetMaxRange() const
Gets the maximum distance at which this entity can be heard.
bool DefineState(csRef< iDocumentNode > stateNode)
Create a new state from an XML <state> node.
void SetAsFactoryEntity(const char *factoryName)
Sets this object as a factory entity.
uint GetMeshID() const
Get the ID of the mesh associated to this entity.
void SetActive(bool toggle)
Activate or deactivate this entity.
bool IsFactoryEntity() const
Return true if this is a factory entity.
void SetState(int state, bool forceChange, bool setReady)
Set the new state for the entity.
csVector3 GetPosition()
Returns the 3d position of this entity.
void Update(int time, float distance, int interval, SoundControl *&ctrl, csVector3 entityPosition)
Update the entity's activation status, play the sound associated with the current state if all condit...
This object represents a planeshift entity sound.