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 | Static Public Member Functions | Private Member Functions | Private Attributes
makVrv::DtFogSignalManager Class Reference

DE-scoped manager that owns one DtFogSignalController per audio fog-signal feature (typically streamed from fogsig.mbtiles via the FogSignalBuoys osgEarth style).

Subscribes to DtTerrainSignaler::signal_buoyOrBeaconFogSignalRequested and DtTerrainSignaler::signal_fogSignalAudioCleared. On request, constructs a controller keyed by the supplied DtUniqueID. On clear, erases the controller. Every DtDe post-tick, evaluates the global visibility against myFogVisibilityLevel and ticks every controller with the resulting foggy flag.

Lazily constructed by instance(); a single bootstrap call in DtAudioManager's constructor ensures the manager exists (and therefore is subscribed) before any fog signal feature is created.

See Also
DtFogSignalController, DtTerrainSignaler
Inheritance diagram for makVrv::DtFogSignalManager:
Inheritance graph
[legend]

Public Member Functions

 ~DtFogSignalManager () override
 
void setFogVisibilityLevel (float meters)
 
float fogVisibilityLevel () const
 
const std::map< DtUniqueID,
std::unique_ptr
< DtFogSignalController > > & 
controllers () const
 
bool currentlyFoggy () const
 
DtDe & de () const
 
 DtFogSignalManager (const DtFogSignalManager &)=delete
 
DtFogSignalManager & operator= (const DtFogSignalManager &)=delete
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtFogSignalManager & instance (DtDe &de)
 
static const std::string & theClassName ()
 

Private Member Functions

 DtFogSignalManager (DtDe &de)
 
void slot_buoyOrBeaconFogSignalRequested (DtUniqueID id, const DtVector &position, const std::string &catfog, const std::string &soundFilepath, const std::vector< DtSigseqSlot > &slots, float decibels, const std::string &rawSigseq, const DtFogSignalAttenuation &attenuation, const DtFogWaveAction &waveAction)
 
void slot_fogSignalAudioCleared (DtUniqueID id)
 
void slot_postTick ()
 
void slot_postInitialize ()
 
void slot_renderImGui ()
 

Private Attributes

DtDe & myDe
 
std::map< DtUniqueID,
std::unique_ptr
< DtFogSignalController > > 
myControllers
 
float myFogVisibilityLevel
 
bool myCurrentlyFoggy
 
std::unique_ptr< DtFogSignalImGui > myImGui
 
DtSignalConnectionManager myConnections
 

Constructor & Destructor Documentation

makVrv::DtFogSignalManager::~DtFogSignalManager ( )
override

Destructor; disconnects all signals.

makVrv::DtFogSignalManager::DtFogSignalManager ( const DtFogSignalManager &  )
delete

Copy operations are deleted; the manager is a DE-scoped singleton.

makVrv::DtFogSignalManager::DtFogSignalManager ( DtDe &  de)
explicitprivate

Member Function Documentation

static DtFogSignalManager& makVrv::DtFogSignalManager::instance ( DtDe &  de)
static

Returns or lazily creates the per-DtDe singleton.

Parameters
deSimulation environment.
static const std::string& makVrv::DtFogSignalManager::theClassName ( )
static

Class name used as the DtDe instance-registry key.

void makVrv::DtFogSignalManager::setFogVisibilityLevel ( float  meters)

Sets the visibility threshold in meters.

When the current scene visibility is at or below this value, fog signals are considered active. Default is DtSkyObject::theDefaultFogVisibilityLevel (1000.0 m); the default is overridden at manager initialization by the FogSignals model definition's optional fog_signal_visibility_threshold parameter when present and strictly positive. App code may call this at any time to override the resolved value programmatically.

Parameters
metersThreshold visible distance.
float makVrv::DtFogSignalManager::fogVisibilityLevel ( ) const

Returns the current fog visibility threshold in meters.

const std::map<DtUniqueID, std::unique_ptr<DtFogSignalController> >& makVrv::DtFogSignalManager::controllers ( ) const
inline

Returns the active controller map, keyed by fog signal id.

bool makVrv::DtFogSignalManager::currentlyFoggy ( ) const
inline

Returns true when the most recent post-tick evaluation determined that the world is foggy (i.e. fog signals should be audible). Updated every DE post-tick.

DtDe& makVrv::DtFogSignalManager::de ( ) const
inline

Accessor for the owning DtDe. Used by the ImGui debug helper to reach scene state without taking a circular header dependency.

DtFogSignalManager& makVrv::DtFogSignalManager::operator= ( const DtFogSignalManager &  )
delete
void makVrv::DtFogSignalManager::slot_buoyOrBeaconFogSignalRequested ( DtUniqueID  id,
const DtVector &  position,
const std::string &  catfog,
const std::string &  soundFilepath,
const std::vector< DtSigseqSlot > &  slots,
float  decibels,
const std::string &  rawSigseq,
const DtFogSignalAttenuation &  attenuation,
const DtFogWaveAction &  waveAction 
)
private

Slot connected to DtTerrainSignaler::signal_buoyOrBeaconFogSignalRequested. Creates one DtFogSignalController per fog signal id and stores it keyed by that id. Discards requests with empty slot lists or empty sound file paths. The catfog argument is the parsed CATFOG category label (e.g. "bell"); it is forwarded to the controller for debug display only. rawSigseq is the raw S-57 SIGSEQ string (empty when SIGSEQ was absent and the slot sequence was synthesised); also forwarded to the controller for debug display only. minAudibleDistanceM and maxAudibleDistanceM are optional attenuation-radius overrides in metres (sentinel DtAudioLevel::kUseDefaultDistance / -1.0f = use engine default). priorityString is a lowercase voice-pool priority label parsed via DtAudioLevel::priorityFromString (empty = BACKGROUND_FX). Values of decibels above DtAudioLevel::kVoiceBoostCeilingDbfs (+12 dBFS) are clamped to that ceiling via DtAudioLevel::clampToVoiceCeiling with a one-shot warning naming the offending model definition. Positive values up to +12 dBFS are legitimate voice boost; the resulting linear gain exceeds unity and any samples above digital full scale hard-clip at the DAC. When waveAction.myEnabled is true, the accompanying waveAction configuration is transferred to the new controller via DtFogSignalController::setWaveAction() and the controller's slot vector is regenerated at each cycle rollover from the interpolated period at the current wind speed.

void makVrv::DtFogSignalManager::slot_fogSignalAudioCleared ( DtUniqueID  id)
private

Slot connected to DtTerrainSignaler::signal_fogSignalAudioCleared. Erases the controller for the named id if one exists.

void makVrv::DtFogSignalManager::slot_postTick ( )
private

Slot connected to DtDe::signal_postTick. Computes the foggy flag from current scene visibility and ticks every registered controller.

void makVrv::DtFogSignalManager::slot_postInitialize ( )
private

Slot connected to DtDe::signal_postInitialize. Resolves the scene-wide visibility threshold from the FogSignals model definition (via DtFogSignalConfig) and wires the per-frame ImGui slot. The renderer is not fully constructed at audio-plugin load time, so the signal_update connection cannot be made directly in the constructor; the FogSignals model definition is likewise not guaranteed loaded until this hook fires.

void makVrv::DtFogSignalManager::slot_renderImGui ( )
private

Slot connected to DtRenderer::signal_update. Forwards to the ImGui debug helper.

Member Data Documentation

DtDe& makVrv::DtFogSignalManager::myDe
private

Simulation environment reference.

std::map<DtUniqueID, std::unique_ptr<DtFogSignalController> > makVrv::DtFogSignalManager::myControllers
private

Active controllers, keyed by the fog signal feature's DtUniqueID.

float makVrv::DtFogSignalManager::myFogVisibilityLevel
private

Visibility threshold in meters. Initialized in the constructor to DtSkyObject::theDefaultFogVisibilityLevel and replaced in slot_postInitialize() by the FogSignals model definition's fog_signal_visibility_threshold parameter when authored.

bool makVrv::DtFogSignalManager::myCurrentlyFoggy
private

Most recent evaluation of the foggy gate, updated each post-tick.

std::unique_ptr<DtFogSignalImGui> makVrv::DtFogSignalManager::myImGui
private

ImGui debug overlay helper. Held by unique_ptr so the destructor can be defined out-of-line where DtFogSignalImGui is complete.

DtSignalConnectionManager makVrv::DtFogSignalManager::myConnections
private

Manages signal/slot lifetime.


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)