![]() |
VR-Forces Developer's Guide
|
DtProceduralSoundBehavior that adapts wind audio to the current wind speed.
Creates one audio layer per tier. Each layer is managed by an internal slot behavior that applies a crossfade envelope based on wind speed. The outer behavior returns isActive()=false when wind speed is below the first tier onset.

Public Member Functions | |
| DtWindSoundBehavior (const DtWindSoundConfig &config) | |
| void | setupSound (DtProceduralSound &sound, DtDe &de) override |
| void | update (DtDe &de) override |
| bool | isActive (const DtProceduralSoundBehaviorContext &ctx) const override |
| float | currentVolumeDb (const DtProceduralSoundBehaviorContext &ctx, float channelBaseVolumeDb) const override |
| void | setLocalWindSpeedOverride (bool audible, float speedMs) override |
| void | appendImGuiDebugInfo () const override |
Public Member Functions inherited from makVrv::DtProceduralSoundBehavior | |
| virtual | ~DtProceduralSoundBehavior ()=default |
| virtual void | setLocalPrecipitationOverride (bool raining, float normalizedIntensity) |
| virtual void | setLocalVisibilityOverride (bool hazy, float visibilityMeters) |
| virtual void | setProximityDistance (double distanceMeters) |
| virtual float | proximityDistMeters () const |
| virtual bool | isInRange () const |
| virtual bool | usingLocalOverride () const |
| virtual float | nextIntervalSeconds (const DtProceduralSoundBehaviorContext &ctx, float builtInInterval) const |
| virtual int | selectClip (const DtProceduralSoundBehaviorContext &ctx, const std::vector< float > &weights) const |
| virtual float | selectGain (const DtProceduralSoundBehaviorContext &ctx, float minGain, float maxGain) const |
| virtual float | selectPitch (const DtProceduralSoundBehaviorContext &ctx, float minPitch, float maxPitch) const |
| virtual bool | wantRestart () const |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Private Attributes | |
| DtWindSoundConfig | myConfig |
| std::atomic< float > | myCurrentWindSpeed |
| std::atomic< bool > | myIsWindAudible |
| std::atomic< bool > | myHasLocalWindOverride |
| std::atomic< bool > | myLocalWindAudible |
| std::atomic< float > | myLocalWindSpeedMs |
| std::vector< std::unique_ptr < DtTierSlotBehavior > > | mySlots |
Additional Inherited Members | |
Protected Attributes inherited from makVrv::DtProceduralSoundBehavior | |
| std::atomic< float > | myProximityDistMeters {0.0f} |
|
explicit |
Constructor.
| config | Full tier configuration (paths and crossfade parameters). |
|
overridevirtual |
Configure the wind sound with one layer per wind-speed tier.
| sound | The procedural sound to configure. |
| de | Display engine context; used by the clip loader for path token resolution. |
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
overridevirtual |
Read the current wind speed from DtEnvironment and update atomics.
| de | Display engine context. |
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
overridevirtual |
Returns false when wind speed is below the first tier onset.
| ctx | Current channel context (unused). |
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
overridevirtual |
Returns channelBaseVolumeDb unchanged; each slot handles its own gain curve.
| ctx | Current channel context (unused). |
| channelBaseVolumeDb | Channel base volume in dB. |
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
overridevirtual |
Store a local weather area wind override for the next update().
| audible | True when inside a wind local weather area with speed > 0. |
| speedMs | Blended wind speed in metres per second. |
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
overridevirtual |
Emit ImGui text showing current wind speed and audible/override flags.
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
private |
Full tier configuration.
|
private |
Wind speed in m/s; updated by update().
|
private |
True when speed >= first tier onset.
True when a local weather area override has been set via setLocalWindSpeedOverride().
|
private |
|
private |
Local weather area audible flag, written by setLocalWindSpeedOverride().
|
private |
Local weather area wind speed (m/s), written by setLocalWindSpeedOverride().
|
private |
Per-tier slot behaviors.