![]() |
VR-Forces Developer's Guide
|
DtEntityConditionalAudializer 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 | slot_wrmStateSet (int stateNumber, int stateValue) |
| virtual void | playAudioBasedOnCriteria () |
| 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 |
| DtAudioPlayCriteria | myVisualizationCriteria |
Protected Attributes inherited from makVrv::DtEntityStateVisualizer | |
| 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::DtEntityConditionalAudializer::DtEntityConditionalAudializer | ( | DtBaseConnection & | simulation, |
| DtStateListener & | listener, | ||
| DtSceneObjectAgent * | sceneObject, | ||
| DtModelSetId | modelSet | ||
| ) |
Constructs a conditional audializer that drives a sound component agent based on WRM state conditions.
| 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.
Reimplemented from makVrv::DtEntityStateVisualizer.
|
virtual |
Destroys all currently created sound model agents.
Reimplemented from makVrv::DtEntityStateVisualizer.
|
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 evaluates the play criteria.
Reimplemented from makVrv::DtEntityStateVisualizer.
|
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::DtEntityConditionalAudializer::entityStateListener | ( | ) |
Get the entity state listener.
DtEntityStateListener driving this audializer. | const DtEntityStateListener& makVrv::DtEntityConditionalAudializer::entityStateListener | ( | ) | const |
Const overload of entityStateListener().
|
overrideprotectedvirtual |
Sets member variables from the visualizer definition if they exist.
Reimplemented from makVrv::DtStateVisualizer.
|
protectedvirtual |
Slot invoked when a WRM state changes on the listener.
| stateNumber | WRM state identifier. |
| stateValue | New value for the state. |
|
protectedvirtual |
Plays the sound if every WRM state requirement is currently satisfied, otherwise stops it.
|
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 |
Conditions that determine whether the sound should be playing.