VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtFogSignalController.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvAudio/vrvAudio.h>
13 #include <vrvAudio/DtAudioLevel.h>
14 
16 #include <vrvCore/DtSigseqParse.h>
17 
18 #include <matrix/vlVector.h>
19 
20 #include <makAudio/abstractAudio.h>
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 namespace makVrv
27 {
28 
29  class DtDe;
30  class DtSoundComponent;
31 
76  {
77  public:
105  const DtVector& position,
106  const std::string& category,
107  const std::string& soundFilepath,
108  const std::vector<DtSigseqSlot>& slots,
109  float decibels,
110  const std::string& rawSigseq,
111  float minAudibleDistanceM,
112  float maxAudibleDistanceM,
113  makAudio::DtAbstractAudio::Priority priority);
114 
117 
120  DtFogSignalController& operator=(const DtFogSignalController&) = delete;
121 
157  void update(double tNow);
158 
181  void resync(double tNow);
182 
185  void setPosition(const DtVector& position);
186 
188  const DtVector& position() const;
189 
191  const std::string& category() const;
192 
194  const std::string& soundFilepath() const;
195 
198  const std::string& rawSigseq() const;
199 
202  int slotCursor() const;
203 
205  int slotCount() const;
206 
209  bool isCurrentSlotSounding() const;
210 
212  float totalPeriodSec() const;
213 
222  void setWaveAction(std::unique_ptr<makVrv::DtFogWaveAction> waveAction);
223 
236  void setLocalWindOverride(bool audible, float speedMs);
237 
239  bool hasWaveAction() const { return myWaveAction != nullptr; }
240 
243  float currentWindMs() const { return myLastWindMs; }
244 
247  float currentPeriodSeconds() const { return myLastComputedPeriodSeconds; }
248 
251  bool isCurrentlySounding() const { return myIsCurrentlySounding; }
252 
255  bool usingLocalWeather() const
256  {
257  return myWaveAction != nullptr && myWaveAction->myUseLocalWeather;
258  }
259 
263  float minAudibleDistanceM() const { return myMinAudibleDistanceM; }
264 
268  float maxAudibleDistanceM() const { return myMaxAudibleDistanceM; }
269 
270  private:
273 
275  DtVector myPosition;
276 
278  std::string myCategory;
279 
281  std::string mySoundFilepath;
282 
285  std::string myRawSigseq;
286 
288  std::vector<DtSigseqSlot> mySlotSequence;
289 
292 
294  double myTimer;
295 
299 
303 
305  makAudio::DtAbstractAudio::Priority myPriority;
306 
309  std::unique_ptr<DtSoundComponent> mySoundComponent;
310 
312  std::unique_ptr<makVrv::DtFogWaveAction> myWaveAction;
313 
316  bool myIsCurrentlySounding = false;
317 
320  bool myHasLocalWindOverride = false;
321 
324  float myLocalWindMsOverride = 0.0f;
325 
328  float myLastWindMs = 0.0f;
329 
332  float myLastComputedPeriodSeconds = 0.0f;
333  };
334 
335 } // namespace makVrv
int mySlotCursor
Index of the slot currently being timed.
Definition: DtFogSignalController.h:291
double myTimer
Absolute simulation time at which the current slot expires.
Definition: DtFogSignalController.h:294
float myMaxAudibleDistanceM
Outer-radius override for 3D distance attenuation, in metres. DtAudioLevel::kUseDefaultDistance = use...
Definition: DtFogSignalController.h:302
float minAudibleDistanceM() const
Inner-radius (reference-distance) override authored on the FogSignalSounds schema for this controller...
Definition: DtFogSignalController.h:263
std::string myCategory
Parsed CATFOG category label, retained for debug display.
Definition: DtFogSignalController.h:278
Tokeniser for S-57 SIGSEQ fog/light signal sequence strings.
std::string myRawSigseq
Raw S-57 SIGSEQ string, retained for debug display. Empty when SIGSEQ was absent and the slot sequenc...
Definition: DtFogSignalController.h:285
Contains the DLL export macro for vrvAudio classes.
float myMinAudibleDistanceM
Inner-radius override for 3D distance attenuation, in metres. DtAudioLevel::kUseDefaultDistance = use...
Definition: DtFogSignalController.h:298
bool hasWaveAction() const
Returns true when a wave-action configuration is attached.
Definition: DtFogSignalController.h:239
Contains the DtFogWaveAction value type and periodForWindSpeed helper used by the fog signal wave-act...
DtVector myPosition
World position of the buoy or beacon.
Definition: DtFogSignalController.h:275
std::vector< DtSigseqSlot > mySlotSequence
Parsed SIGSEQ slot sequence. Empty when the buoy has no signal.
Definition: DtFogSignalController.h:288
std::unique_ptr< DtSoundComponent > mySoundComponent
Embedded positional sound. Held by unique_ptr because DtSoundComponent&#39;s default constructor is delet...
Definition: DtFogSignalController.h:309
DtDe & myDe
Simulation environment reference.
Definition: DtFogSignalController.h:272
std::string mySoundFilepath
Resolved sound filepath, retained for debug display.
Definition: DtFogSignalController.h:281
Drives the on/off sequence of a single buoy or beacon fog signal.
Definition: DtFogSignalController.h:75
bool usingLocalWeather() const
True when the attached wave-action configuration asks the runtime to consult DtLocalWeatherQuery befo...
Definition: DtFogSignalController.h:255
bool isCurrentlySounding() const
True when the current slot is sounding and the sound component was started.
Definition: DtFogSignalController.h:251
makAudio::DtAbstractAudio::Priority myPriority
Voice-pool preemption priority for this sound.
Definition: DtFogSignalController.h:305
#define DT_DLL_VRVAUDIO
Definition: vrvAudio.h:20
std::unique_ptr< makVrv::DtFogWaveAction > myWaveAction
Wave-action configuration. Null when disabled (default).
Definition: DtFogSignalController.h:312
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Contains the DtAudioLevel utility class.
float currentPeriodSeconds() const
Interpolated cycle period (seconds) used for the most recent cycle-rollover regeneration. Zero until the first rollover.
Definition: DtFogSignalController.h:247
float currentWindMs() const
Wind speed (m/s) used for the most recent cycle-rollover regeneration. Zero until the first rollover...
Definition: DtFogSignalController.h:243
float maxAudibleDistanceM() const
Outer-radius override authored on the FogSignalSounds schema for this controller, in metres...
Definition: DtFogSignalController.h:268

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)