VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
makVrv::DtVisibilitySoundBehavior Class Reference

DtProceduralSoundBehavior that adapts audio to the current visibility distance.

Creates one audio layer per tier. Each layer is managed by an internal slot behavior that applies a crossfade envelope based on normalised fog intensity. Fog intensity is computed as max(0, 1 - visibilityMeters / clearVisibilityMeters), so dense fog (low metres) maps to high intensity and clear sky maps to 0. The outer behavior returns isActive()=false when visibility is at or above clearVisibilityMeters.

Inheritance diagram for makVrv::DtVisibilitySoundBehavior:
Inheritance graph
[legend]

Public Member Functions

 DtVisibilitySoundBehavior (const DtVisibilitySoundConfig &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 setLocalVisibilityOverride (bool hazy, float visibilityMeters) override
 
void setProximityDistance (double distanceMeters) override
 
bool isInRange () const override
 
bool usingLocalOverride () const override
 
void appendImGuiDebugInfo () const override
 
- Public Member Functions inherited from makVrv::DtProceduralSoundBehavior
virtual ~DtProceduralSoundBehavior ()=default
 
virtual void setLocalPrecipitationOverride (bool raining, float normalizedIntensity)
 
virtual void setLocalWindSpeedOverride (bool audible, float speedMs)
 
virtual float proximityDistMeters () 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

DtVisibilitySoundConfig myConfig
 
std::atomic< float > myFogIntensity
 
std::atomic< bool > myIsHazy
 
std::atomic< bool > myHasLocalVisOverride
 
std::atomic< bool > myLocalHazy
 
std::atomic< float > myLocalVisMeters
 
std::atomic< bool > myIsInRange
 
std::atomic< bool > myUsingLocalOverride
 
std::vector< std::unique_ptr
< DtTierSlotBehavior > > 
mySlots
 

Additional Inherited Members

- Protected Attributes inherited from makVrv::DtProceduralSoundBehavior
std::atomic< float > myProximityDistMeters {0.0f}
 

Constructor & Destructor Documentation

makVrv::DtVisibilitySoundBehavior::DtVisibilitySoundBehavior ( const DtVisibilitySoundConfig &  config)
explicit

Constructor.

Parameters
configFull tier configuration (paths and crossfade parameters).

Member Function Documentation

void makVrv::DtVisibilitySoundBehavior::setupSound ( DtProceduralSound &  sound,
DtDe &  de 
)
overridevirtual

Configure the visibility sound with one layer per tier.

Parameters
soundThe procedural sound to configure.
deDisplay engine context; used by the clip loader for path token resolution.

Reimplemented from makVrv::DtProceduralSoundBehavior.

void makVrv::DtVisibilitySoundBehavior::update ( DtDe &  de)
overridevirtual

Read the current visibility distance from DtEnvironment and update atomics.

Parameters
deDisplay engine context.

Reimplemented from makVrv::DtProceduralSoundBehavior.

bool makVrv::DtVisibilitySoundBehavior::isActive ( const DtProceduralSoundBehaviorContext &  ctx) const
overridevirtual

Returns false when visibility is at or above clearVisibilityMeters.

Parameters
ctxCurrent channel context (unused).
Returns
true when conditions are hazy/foggy.

Reimplemented from makVrv::DtProceduralSoundBehavior.

float makVrv::DtVisibilitySoundBehavior::currentVolumeDb ( const DtProceduralSoundBehaviorContext &  ctx,
float  channelBaseVolumeDb 
) const
overridevirtual

Returns channelBaseVolumeDb unchanged; each slot handles its own gain curve.

Parameters
ctxCurrent channel context (unused).
channelBaseVolumeDbChannel base volume in dB.
Returns
channelBaseVolumeDb.

Reimplemented from makVrv::DtProceduralSoundBehavior.

void makVrv::DtVisibilitySoundBehavior::setLocalVisibilityOverride ( bool  hazy,
float  visibilityMeters 
)
overridevirtual

rief Store a local weather area visibility override for the next update().

Parameters
hazyTrue when inside a visibility local weather area.
visibilityMetersRaw visibility distance in metres from the local area.

Reimplemented from makVrv::DtProceduralSoundBehavior.

void makVrv::DtVisibilitySoundBehavior::setProximityDistance ( double  distanceMeters)
overridevirtual

Cache the listener-to-entity distance and update the proximity gate.

Parameters
distanceMetersEuclidean distance in metres from the listener to the entity.

Reimplemented from makVrv::DtProceduralSoundBehavior.

bool makVrv::DtVisibilitySoundBehavior::isInRange ( ) const
overridevirtual

Returns true if the entity is within maxRangeMeters of the listener.

Returns
true when maxRangeMeters == 0 (no gate) or distance <= maxRangeMeters.

Reimplemented from makVrv::DtProceduralSoundBehavior.

bool makVrv::DtVisibilitySoundBehavior::usingLocalOverride ( ) const
overridevirtual

Returns true when a local weather area provided the visibility value this frame.

Returns
true when the local weather area path was taken in the last update().

Reimplemented from makVrv::DtProceduralSoundBehavior.

void makVrv::DtVisibilitySoundBehavior::appendImGuiDebugInfo ( ) const
overridevirtual

Emit ImGui text showing current fog intensity and hazy/override flags.

Reimplemented from makVrv::DtProceduralSoundBehavior.

Member Data Documentation

DtVisibilitySoundConfig makVrv::DtVisibilitySoundBehavior::myConfig
private

Full tier configuration.

std::atomic<float> makVrv::DtVisibilitySoundBehavior::myFogIntensity
private

Normalised fog intensity [0,1]; updated by update().

std::atomic<bool> makVrv::DtVisibilitySoundBehavior::myIsHazy
private

True when visibility is below clearVisibilityMeters.

True when a local weather area override is pending via setLocalVisibilityOverride().

std::atomic<bool> makVrv::DtVisibilitySoundBehavior::myHasLocalVisOverride
private
std::atomic<bool> makVrv::DtVisibilitySoundBehavior::myLocalHazy
private

Local weather area hazy gate, written by setLocalVisibilityOverride().

std::atomic<float> makVrv::DtVisibilitySoundBehavior::myLocalVisMeters
private

Local weather area raw visibility in metres, written by setLocalVisibilityOverride().

std::atomic<bool> makVrv::DtVisibilitySoundBehavior::myIsInRange
private

True when the entity is within maxRangeMeters of the listener (or when maxRangeMeters == 0).

std::atomic<bool> makVrv::DtVisibilitySoundBehavior::myUsingLocalOverride
private

True when the local weather area path was taken in the last update().

std::vector<std::unique_ptr<DtTierSlotBehavior> > makVrv::DtVisibilitySoundBehavior::mySlots
private

Per-tier slot behaviors.


The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)