Per-De abstract interface for creating and destroying model-definition-driven sound components.
This interface is stored as a per-De instance (via DtDe::registerInstance) and is accessible to any vrvCore code that holds a DtDe reference. The concrete implementation is provided by vrvAudio (DtModelSoundCreator) and registered during DtAudioManager construction. When vrvAudio is not present, findInstance() returns nullptr and all call sites silently skip sound creation.
Supported model definition parameters:
- sound_filepath path to a WAV or OGG file
- procedural_sound_name procedural sound factory key
- sound_behavior_key optional behavior-backed procedural sound key
- sound_behavior_param_* key-value parameters forwarded to the behavior creator
- sound_local_weather_area_enabled enable per-frame local weather area queries feeding the behavior
- sound_decibels authored playback level in dBFS (default 0.0)
- min_audible_distance_m inner-radius override in metres, sentinel -1 = engine default
- max_audible_distance_m outer-radius override in metres, sentinel -1 = engine default
- sound_priority voice-pool preemption priority (background_fx / secondary_fx / primary_fx / music / dialog)
- sound_positional_offset local body-frame XYZ offset from the model origin
| virtual void makVrv::DtSoundCreatorInterface::onModelDefinitionSet |
( |
DtModel & |
model, |
|
|
const DtModelDefinition * |
definition |
|
) |
| |
|
pure virtual |
Called whenever a model definition is applied to a DtModel.
Implementations must destroy any previously created sound for model.uniqueId(), then inspect definition for sound parameters. If sound parameters are present a new DtSoundComponent is created, configured, and played. If definition is nullptr or carries no sound parameters only the destroy step is performed.
- Parameters
-
| model | The model whose definition changed. |
| definition | The new model definition, or nullptr if the definition name was empty or unknown. |
Implemented in makVrv::DtModelSoundCreator.