VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtFogWaveAction.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
10 
11 #pragma once
12 
13 #include <algorithm>
14 
15 namespace makVrv
16 {
17 
29  {
36  bool myEnabled = false;
37 
39  float myCalmWindMs = 0.0f;
40 
42  float myRoughWindMs = 15.0f;
43 
45  float myCalmPeriodSeconds = 0.0f;
46 
48  float myRoughPeriodSeconds = 0.0f;
49 
53  bool myUseLocalWeather = false;
54  };
55 
67  inline float periodForWindSpeed(const DtFogWaveAction& cfg, float windMs)
68  {
69  constexpr float kMinPeriodFloor = 3.0f;
70  const float wLow = cfg.myCalmWindMs;
71  const float wHigh = cfg.myRoughWindMs;
72  const float pLow = cfg.myCalmPeriodSeconds;
73  const float pHigh = cfg.myRoughPeriodSeconds;
74 
75  float period;
76  if (windMs <= wLow || wHigh <= wLow)
77  {
78  period = pLow;
79  }
80  else if (windMs >= wHigh)
81  {
82  period = pHigh;
83  }
84  else
85  {
86  const float t = (windMs - wLow) / (wHigh - wLow);
87  period = pLow + t * (pHigh - pLow);
88  }
89  return std::max(period, kMinPeriodFloor);
90  }
91 
92 } // namespace makVrv
float myRoughPeriodSeconds
Fog signal cycle period (seconds) at the rough-sea anchor.
Definition: DtFogWaveAction.h:48
Wave-action fog signal cadence configuration.
Definition: DtFogWaveAction.h:28
float myRoughWindMs
Wind speed (m/s) at the rough-sea anchor. Default 15.0.
Definition: DtFogWaveAction.h:42
float myCalmWindMs
Wind speed (m/s) at the calm-sea anchor. Default 0.0.
Definition: DtFogWaveAction.h:39
bool myUseLocalWeather
When true, the runtime resolves wind speed via DtLocalWeatherQuery::getLocalWind at the observer posi...
Definition: DtFogWaveAction.h:53
float myCalmPeriodSeconds
Fog signal cycle period (seconds) at the calm-sea anchor.
Definition: DtFogWaveAction.h:45
bool myEnabled
When false, the runtime treats this configuration as absent and falls back to the model&#39;s static SIGS...
Definition: DtFogWaveAction.h:36
float periodForWindSpeed(const DtFogWaveAction &cfg, float windMs)
Compute the fog signal period for a given wind speed.
Definition: DtFogWaveAction.h:67

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)