Concrete DtSoundCreatorInterface that creates and manages DtSoundComponent objects for models whose definitions carry sound parameters.
One instance per De, registered by DtAudioManager during construction. Reads the following parameters from a DtModelDefinition:
- sound_filepath path to a WAV or OGG file (exclusive with procedural_sound_name)
- procedural_sound_name procedural sound factory key
- sound_behavior_key optional behavior-backed procedural sound key (takes precedence over sound_filepath and procedural_sound_name)
- sound_behavior_param_* key-value parameters forwarded to the behavior creator (prefix stripped)
- sound_local_weather_area_enabled when true and sound_behavior_key is set, local weather area queries feed the behavior
- sound_decibels authored playback level in dBFS (0 = unity, negative attenuates; values above 0 are clamped with a one-shot warning)
- min_audible_distance_m inner-radius override in metres. Sentinel DtAudioLevel::kUseDefaultDistance keeps the audio engine's physical-model reference distance in place
- max_audible_distance_m outer-radius override in metres. Sentinel DtAudioLevel::kUseDefaultDistance keeps the audio engine's physical-model max-falloff distance in place
- sound_priority voice-pool preemption priority. One of background_fx (default), secondary_fx, primary_fx, music, dialog. Parsed via DtAudioLevel::priorityFromString
- sound_positional_offset local body-frame XYZ offset from the model origin (DtVector format, default 0 0 0)
- Note
- The filename, sound_decibels, min/max_audible_distance_m, and sound_priority parameters are parsed via the shared static helper DtSoundComponent::populateFromSoundSchema so that every Sound-schema consumer honors them uniformly.
| virtual void makVrv::DtModelSoundCreator::onModelDefinitionSet |
( |
DtModel & |
model, |
|
|
const DtModelDefinition * |
definition |
|
) |
| |
|
overridevirtual |
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. |
Implements makVrv::DtSoundCreatorInterface.