![]() |
VR-Forces Developer's Guide
|
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.

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 |
|
override |
Destructor; disconnects all signals.
|
delete |
Copy operations are deleted; the manager is a DE-scoped singleton.
|
explicitprivate |
|
static |
Returns or lazily creates the per-DtDe singleton.
| de | Simulation environment. |
|
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.
| meters | Threshold visible distance. |
| float makVrv::DtFogSignalManager::fogVisibilityLevel | ( | ) | const |
Returns the current fog visibility threshold in meters.
|
inline |
Returns the active controller map, keyed by fog signal id.
|
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.
|
inline |
|
delete |
|
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.
|
private |
Slot connected to DtTerrainSignaler::signal_fogSignalAudioCleared. Erases the controller for the named id if one exists.
|
private |
Slot connected to DtDe::signal_postTick. Computes the foggy flag from current scene visibility and ticks every registered controller.
|
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.
|
private |
Slot connected to DtRenderer::signal_update. Forwards to the ImGui debug helper.
|
private |
Simulation environment reference.
|
private |
Active controllers, keyed by the fog signal feature's DtUniqueID.
|
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.
|
private |
Most recent evaluation of the foggy gate, updated each post-tick.
|
private |
ImGui debug overlay helper. Held by unique_ptr so the destructor can be defined out-of-line where DtFogSignalImGui is complete.
|
private |
Manages signal/slot lifetime.