![]() |
VR-Forces Developer's Guide
|
Abstract per-tier slot behavior that applies a four-point gain envelope to a single audio layer.
Subclasses implement currentSignal() and isSignalActive() to supply the envelope's input signal from std::atomic members. The gain computation is performed in computeGain() and is shared by all concrete subclasses.
Threading contract: all virtual methods are called from the audio thread. Do NOT access DtDe or any non-thread-safe simulation data.

Public Member Functions | |
| DtTierSlotBehavior (const DtTierGainCurve &curve) | |
| virtual | ~DtTierSlotBehavior () |
| DtTierSlotBehavior (const DtTierSlotBehavior &)=delete | |
| DtTierSlotBehavior & | operator= (const DtTierSlotBehavior &)=delete |
| virtual bool | isActive (const DtProceduralSoundBehaviorContext &ctx) const override |
| virtual float | currentVolumeDb (const DtProceduralSoundBehaviorContext &ctx, float channelBaseVolumeDb) const override |
| float | currentGain () const |
Public Member Functions inherited from makVrv::DtProceduralSoundBehavior | |
| virtual | ~DtProceduralSoundBehavior ()=default |
| virtual void | setupSound (DtProceduralSound &sound, DtDe &de) |
| virtual void | update (DtDe &de) |
| virtual void | setLocalPrecipitationOverride (bool raining, float normalizedIntensity) |
| virtual void | setLocalWindSpeedOverride (bool audible, float speedMs) |
| 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 void | appendImGuiDebugInfo () 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 () |
Protected Member Functions | |
| virtual float | currentSignal () const =0 |
| virtual bool | isSignalActive () const =0 |
Static Protected Member Functions | |
| static float | computeGain (float x, const DtTierGainCurve &curve) |
Protected Attributes | |
| DtTierGainCurve | myGainCurve |
Protected Attributes inherited from makVrv::DtProceduralSoundBehavior | |
| std::atomic< float > | myProximityDistMeters {0.0f} |
|
explicit |
Construct with the given gain curve.
| curve | Four-point gain envelope parameters. |
|
virtual |
Virtual destructor.
|
delete |
|
delete |
|
overridevirtual |
Return true when the signal is active and within the envelope's range.
| ctx | Current channel context. |
Reimplemented from makVrv::DtProceduralSoundBehavior.
|
overridevirtual |
Compute the effective volume in dB by applying the gain envelope.
| ctx | Current channel context. |
| channelBaseVolumeDb | Channel's configured base volume in dB. |
Reimplemented from makVrv::DtProceduralSoundBehavior.
| float makVrv::DtTierSlotBehavior::currentGain | ( | ) | const |
Current linear gain in [0, 1] applied to this tier's layer (for diagnostics). Returns 0.0 when the signal gate is inactive or the envelope evaluates to silence. Safe to call from the main thread; reads are via std::atomic in concrete subclasses.
|
protectedpure virtual |
Return the current signal value.
Implemented in makVrv::DtRainSlotBehavior, makVrv::DtVisibilitySlotBehavior, and makVrv::DtWindSlotBehavior.
|
protectedpure virtual |
Return false to gate the entire tier to silence.
Implemented in makVrv::DtRainSlotBehavior, makVrv::DtVisibilitySlotBehavior, and makVrv::DtWindSlotBehavior.
|
staticprotected |
Compute linear gain in [0, 1] from a signal value and a gain curve.
| x | Current signal value. |
| curve | Gain envelope parameters. |
|
protected |
Four-point gain envelope for this tier.