![]() |
VR-Forces Developer's Guide
|
DtEntityAudializer manages the sound for an entity. The sound will update itself according to the entity's state. It points to a sound model definition, you can configure the filename, decibel,etc.

Static Public Member Functions | |
| static const DtStateVisualizer::TypeInfo & | theTypeInfo () |
Protected Member Functions | |
| virtual void | setInitialValuesFromVisualizerDefinition () override |
| virtual void | connectToListenerSignals () override |
Protected Member Functions inherited from makVrv::DtStateVisualizer | |
| virtual void | makeVisible () |
| template<typename T , typename C > | |
| void | connectAndUpdate (boost::signalslib::signal< void(T)> &sig, void(C::*fp)(T), T val) |
Protected Attributes | |
| DtSoundComponentAgent * | mySoundComponentAgent |
| bool | myIs3d |
| float | myDecibel |
| DtVector | myOffset |
| EntityStateListener::DamageState | myDamageState |
| bool | myPowerPlantOn |
| DtEntityStateListener * | myEntityListener |
Protected Attributes inherited from makVrv::DtStateVisualizer | |
| DtBaseConnection & | mySimulation |
| DtStateListener & | myListener |
| DtUniqueID | mySceneObjectID |
| std::string | myName |
| std::string | myModelDefinition |
| DtSignalConnectionManager | myConnections |
| DtModelSetId | myModelSet |
| int | myVisualizerType |
| bool | myDistributeFlag |
| bool | myPickable |
| bool | myVisible |
| bool | myInitialInitializeDone |
| const DtVisualizerDefinition * | myVisualizerDefinition |
| DtSceneObjectAgent * | mySceneObjectAgent |
| ShowHideContextVector | myVisualizerShowHideContexts |
Additional Inherited Members | |
Public Types inherited from makVrv::DtStateVisualizer | |
| enum | Type { AllVisualizerTypes = 0, EntityVisualizerType = 1, EnvironmentalVisualizerType, InteractionVisualizerType, AggregateVisualizerType, IntervisibilityVisualizerType, TacticalSmokeVisualizerType, SoundInteractionVisualizerType, UserType = 10000 } |
Protected Types inherited from makVrv::DtStateVisualizer | |
| typedef std::vector < DtVisualizerShowHideContext::VisualizerShowHideContext > | ShowHideContextVector |
| makVrv::DtEntityAudializer::DtEntityAudializer | ( | DtBaseConnection & | simulation, |
| DtStateListener & | listener, | ||
| DtSceneObjectAgent * | sceneObject, | ||
| DtModelSetId | modelSet | ||
| ) |
Constructs an audializer that drives a sound component agent from entity state.
| simulation | Simulation connection used to create and own the agents. |
| listener | State listener whose updates drive the sound. |
| sceneObject | Scene object the sound is attached to. |
| modelSet | Model set used to resolve the sound model definition. |
|
virtual |
Destroys the audializer and any owned sound component agent.
|
delete |
Default construction is not allowed.
|
delete |
Copy construction is not allowed.
|
delete |
Copy assignment is not allowed.
|
overridevirtual |
Initializes the signals and starting state from the listener.
Reimplemented from makVrv::DtStateVisualizer.
|
virtual |
Creates the model agents used to play sound for the entity.
Implements makVrv::DtStateVisualizer.
|
virtual |
Destroys all currently created sound model agents.
Implements makVrv::DtStateVisualizer.
|
virtual |
Returns the runtime type info for this visualizer.
theTypeInfo(). Implements makVrv::DtStateVisualizer.
|
static |
Static class-level type info.
|
virtual |
Pushes the current is3d, decibel and offset settings to the sound component agent and starts playback.
Implements makVrv::DtStateVisualizer.
|
virtual |
Sets whether the entity's power plant is on.
| on | Whether the entity's power plant is on. |
|
virtual |
Sets the damage state for the entity.
| damageState | New damage state reported for the entity. |
|
virtual |
Gets whether the entity is destroyed.
DamageDestroyed.
|
virtual |
Starts or stops audio playback based on engine state.
| running | Whether the entity's engine is running. |
|
virtual |
Plays the sound.
|
virtual |
Stops the sound.
|
virtual |
Sets whether the sound should be played in 3D.
| is3d | True to play the sound spatialized in 3D, false to play it 2D. |
|
virtual |
Gets whether the sound is played in 3D.
|
virtual |
Sets the playback level of the sound in decibels.
| decibel | Playback level in decibels; default is 80. |
|
virtual |
Gets the playback level of the sound in decibels.
|
virtual |
Sets a body-frame position offset (forward, right, down) applied to the sound relative to the parent entity's scene object. Forwarded to the underlying sound component agent.
| offset | Body-frame offset in metres; components are (forward, right, down). |
|
virtual |
Gets the current body-frame position offset of the sound.
| DtEntityStateListener& makVrv::DtEntityAudializer::entityStateListener | ( | ) |
Get the entity state listener.
DtEntityStateListener driving this audializer. | const DtEntityStateListener& makVrv::DtEntityAudializer::entityStateListener | ( | ) | const |
Const overload of entityStateListener().
|
overrideprotectedvirtual |
Sets member variables from the visualizer definition if they exist.
Reimplemented from makVrv::DtStateVisualizer.
|
overrideprotectedvirtual |
Connects the visualizer to the listener's signals.
Reimplemented from makVrv::DtStateVisualizer.
|
protected |
Owned agent that performs the actual sound playback.
|
protected |
Whether the sound is played spatialized in 3D.
|
protected |
Playback level in decibels; default is 80.
|
protected |
Body-frame offset (forward, right, down) in metres.
|
protected |
Last damage state reported for the entity.
|
protected |
Whether the entity's power plant is currently on.
|
protected |
Same as myListener, but cast to DtEntityStateListener for convenience.