![]() |
VR-Forces Developer's Guide
|
DtSoundComponentSystem manages the active sounds in the scene.
This system handles:

Public Member Functions | |
| virtual | ~DtSoundComponentSystem () |
| DtSoundComponentSystem (const DtSoundComponentSystem &other)=delete | |
| DtSoundComponentSystem (DtSoundComponentSystem &&other)=delete | |
| DtSoundComponentSystem & | operator= (const DtSoundComponentSystem &other)=delete |
| DtSoundComponentSystem & | operator= (DtSoundComponentSystem &&other)=delete |
| virtual void | addSound (DtSoundComponent *sound) |
| virtual void | removeSound (DtSoundComponent *sound) |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static DtSoundComponentSystem & | instance (DtDe &de) |
| static void | registerInstance (DtDe &de, DtSoundComponentSystem *system) |
| static const std::string & | theClassName () |
Protected Member Functions | |
| DtSoundComponentSystem (DtDe &de) | |
| virtual void | slot_postUpdate (double simTime) |
| virtual void | slot_sceneObjectToBeDeleted (const DtUniqueID &id) |
| virtual void | slot_audioListenerObserverChanged (DtObserver *observer) |
| virtual void | slot_currentObserverModeChanged (int observerMode) |
| virtual void | handleDelayedSoundCreation () |
| virtual void | createAndInitializeSound (DtSoundComponent *soundComponent) |
| virtual void | createProceduralSound (DtSoundComponent *soundComponent, const std::string &behaviorKey=std::string(), const std::map< std::string, std::string > &behaviorParams=std::map< std::string, std::string >(), bool localWeatherAreaEnabled=false) |
| virtual void | resolveAndWireSceneObject (DtSoundComponent *soundComponent) |
| virtual void | initialize () |
| virtual void | createImGui () |
| virtual void | slot_renderImGui () |
Friends | |
| class | DtSoundComponent |
| class | DtSoundComponentSystemImGui |
|
virtual |
DTOR.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
delete |
Move Constructor not implemented - Move not allowed.
|
protected |
Protected CTOR Use DtSoundComponentSystem::instance(DtDe&).
|
static |
Get/Create the DtSoundComponentSystem instance. Use DtSoundComponentSystem::registerInstance(...) to override the class instance.
|
static |
Register the provided instance of a DtSoundComponentSystem.
|
static |
Get the name used to register this class.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
delete |
Move Assignment Operator not implemented - Move Assignment not allowed.
|
virtual |
Add a sound component to the system.
Audio creation for a 3D scene-object-attached component is deferred until the scene object has completed an update. Other components are created immediately.
| sound | The sound component to add |
|
virtual |
Remove a sound component from the system and clean up resources.
| sound | The sound component to remove |
|
protectedvirtual |
Slot connected to DtRenderer::signal_postUpdate Updates sound positions each frame for sounds attached to scene objects.
| simTime | The current simulation time |
|
protectedvirtual |
Slot connected to DtSceneObject::signal_sceneObjectToBeDeleted Handles cleanup when a scene object with attached sounds is being deleted.
| id | The unique ID of the scene object being deleted |
|
protectedvirtual |
Slot connected to DtAudioManager::signal_audioListenerObserverChanged Handles switching to a new observer and its associated observer mode.
| observer | The new current observer (may be nullptr) |
|
protectedvirtual |
Slot connected to DtObserver::signal_observerModeChanged Pauses sounds in the old model set and resumes sounds in the new model set.
| observerMode | The new observer mode |
|
protectedvirtual |
Handle creation of sounds that were deferred due to audio device not being ready.
|
protectedvirtual |
|
protectedvirtual |
Create and start a procedural sound for the given component.
When behaviorKey is non-empty, creates a behavior-backed procedural sound via DtProceduralSoundBehaviorFactory instead of looking up the key from the filename prefix. When behaviorKey is empty, falls back to the existing filename-based DtProceduralSoundFactory lookup.
| soundComponent | Component to attach the procedural sound to. |
| behaviorKey | Optional behavior factory key. |
| behaviorParams | Key-value params forwarded to the behavior creator. |
| localWeatherAreaEnabled | When true, local weather area queries are performed before each behavior update. |
|
protectedvirtual |
Resolve mySceneObjectId to a mySceneObject pointer on the component and connect its scene-object deletion signal.
Idempotent: safe to call more than once. A no-op if the pointer is already resolved. Called during initial wiring and again from the per-tick update loop when a late-registering agent finally becomes resolvable.
| soundComponent | The component to resolve and wire. |
|
protectedvirtual |
Two-phase initialization called by instance() after construction.
Connects signal slots and calls createImGui(). Subclasses that override this must call the base-class implementation.
|
protectedvirtual |
Factory method for the ImGui debug panel.
Override in a subclass to supply a custom DtSoundComponentSystemImGui derivative with extended diagnostics.
|
protectedvirtual |
Per-frame ImGui draw call rendering the Sound Component diagnostics tree.
|
friend |
|
friend |
|
protected |
Reference to the DtDe (distributed entity) that owns this system.
|
protected |
Connection manager for the post-update signal (blocked when no sounds need updates)
|
protected |
Connection manager for current observer's signals.
|
protected |
Connection manager for miscellaneous signal connections.
|
protected |
Pointer to the current observer (used to track observer mode changes)
|
protected |
The current model set ID (determines which sounds are active based on observer mode)
|
protected |
Map from scene object unique ID to (sound component, signal connection) pair for deletion handling. The stored connection handle allows safe disconnect without acquiring the signal's internal mutex.
|
protected |
Map from model set ID to the set of sound components in that model set.
|
protected |
Set of sound components that need per-frame position updates.
|
protected |
Two-set swap: sounds added this tick land in myNewSoundComponents; at the end of slot_postUpdate the two sets are swapped so an entry becomes creation-ready in myPendingSoundComponents on the NEXT post-update. This guarantees the attached SceneObject has received at least one update before the underlying makAudio::DtSound is constructed.
3D scene-object-attached components added since the previous post-update.
|
protected |
Components that have completed one update interval and can now be created.
|
protected |
Retry-attempt count for components stuck waiting for a late-registering SceneObjectAgent. Entries only exist for components that have failed at least one resolve; erased on successful resolve or on removeSound.
|
protected |
Map from sound component to its procedural sound. DtSoundComponentSystem owns the sounds.
|
protected |
Set of components backed by a procedural sound that need per-frame tick() calls.
|
protected |
Map from sound component to its behavior-backed procedural sound behavior.
Entries are created by createProceduralSound() when a non-empty behaviorKey is provided and removed by removeSound(). Owned by the system.
|
protected |
Components whose behavior should query local weather areas at model position.
Populated when DtSoundComponentData::myLocalWeatherAreaEnabled is true and myBehaviorKey is non-empty. The system performs a weather-area containment query at the model's world position before each behavior update for these components.
|
protected |
Last simulation time used to compute elapsed dt for procedural sound ticks.
|
protected |
ImGui debug panel renderer (owned).