![]() |
VR-Forces Developer's Guide
|
The DtWeatherAreaObjectManager manages, sets values, and provides signals related to weather area objects (see DtWeatherAreaObject).
The DtWeatherAreaObjectManager is accessed by a singleton. Use addWeatherArea to get a unique id that can be used modify the weather area during the lifetime of the weather area object. Use removeWeatherArea to remove the weather area object when no longer needed.
Signals are provided by this manager for all changes to weather area objects. Each weather area object will trigger the proper signals when modified. A weather area object is a distrubuted object and will trigger the signals on a master and slave.

Public Member Functions | |
| virtual | ~DtWeatherAreaObjectManager () |
| DtWeatherAreaObjectManager ()=delete | |
| DtWeatherAreaObjectManager (const DtWeatherAreaObjectManager &)=delete | |
| DtWeatherAreaObjectManager & | operator= (const DtWeatherAreaObjectManager &)=delete |
| virtual DtWeatherAreaObjectAgent * | findWeatherAreaObjectAgent (DtUniqueID id) |
| virtual DtUniqueID | addWeatherArea () |
| virtual void | removeWeatherArea (DtUniqueID id) |
| virtual void | setWeatherAreaTransform (DtUniqueID id, const DtVector &position, const float orientation) |
| virtual void | setWeatherAreaBounds (DtUniqueID id, const DtVector &bounds, const float cornerRadius) |
| virtual void | setWeatherAreaPrecipitationIntensity (DtUniqueID id, const float intensity) |
| virtual void | setWeatherAreaPrecipitationType (DtUniqueID id, const unsigned int type) |
| virtual void | setWeatherAreaGroundRainAccumulation (DtUniqueID id, const float depth) |
| virtual void | setWeatherAreaFogColor (DtUniqueID id, const DtVector &color) |
| virtual void | setWeatherAreaVisibilityDistance (DtUniqueID id, const float distance) |
| virtual void | setWeatherAreaOvercast (DtUniqueID id, const float overcast) |
| virtual void | setWeatherAreaLightningEnabled (DtUniqueID id, const bool enabled) |
| virtual void | setWeatherAreaWind (DtUniqueID id, const float direction, const float speed) |
| virtual void | weatherAreaObjectCloudLayerAdded (DtUniqueID id, DtCloudLayerId layerId, int cloudType) |
| virtual void | weatherAreaObjectCloudLayerRemoved (DtUniqueID id, DtCloudLayerId layerId) |
| virtual bool | getLocalPrecipitation (const DtVector &observerPos, bool &raining, float &normalizedIntensity) const |
| virtual bool | getLocalWind (const DtVector &observerPos, bool &audible, float &speedMs) const |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static DtWeatherAreaObjectManager & | instance (DtDe &de) |
| static const std::string & | theClassName () |
Public Attributes | |
| boost::signalslib::signal < void(DtUniqueID id, DtWeatherAreaObject *area)> | signal_weatherAreaObjectAdded |
| boost::signalslib::signal < void(DtUniqueID id, DtWeatherAreaObject *area)> | signal_weatherAreaObjectToBeRemoved |
| boost::signalslib::signal < void(DtUniqueID id, const DtVector &position, const float orientation)> | signal_weatherAreaObjectTransformChanged |
| boost::signalslib::signal < void(DtUniqueID id, const DtVector &bounds, const float cornerRadius)> | signal_weatherAreaObjectBoundsChanged |
| boost::signalslib::signal < void(DtUniqueID id, const float intensity)> | signal_weatherAreaObjectPrecipitationIntensityChanged |
| boost::signalslib::signal < void(DtUniqueID id, const unsigned int type)> | signal_weatherAreaObjectPrecipitationTypeChanged |
| boost::signalslib::signal < void(DtUniqueID id, const float depth)> | signal_weatherAreaObjectGroundRainAccumulationChanged |
| boost::signalslib::signal < void(DtUniqueID id, const DtVector &color)> | signal_weatherAreaObjectFogColorChanged |
| boost::signalslib::signal < void(DtUniqueID id, const float distance)> | signal_weatherAreaObjectVisibilityDistanceChanged |
| boost::signalslib::signal < void(DtUniqueID id, const float overcast)> | signal_weatherAreaObjectOvercastChanged |
| boost::signalslib::signal < void(DtUniqueID id, const bool enabled)> | signal_weatherAreaObjectLightningEnabledChanged |
| boost::signalslib::signal < void(DtUniqueID id, const float direction, const float speed)> | signal_weatherAreaObjectWindChanged |
| boost::signalslib::signal < void(DtUniqueID id, DtCloudLayerId layerId, int cloudType)> | signal_weatherAreaObjectCloudLayerAdded |
| boost::signalslib::signal < void(DtUniqueID id, DtCloudLayerId layerId)> | signal_weatherAreaObjectCloudLayerRemoved |
Static Public Attributes | |
| static const float | thePrecipitationQueryEdgeFadeRange |
| static const float | theWindQueryEdgeFadeRange |
Protected Types | |
| typedef std::map< DtUniqueID, DtWeatherAreaObjectAgent * > | WeatherAreaMap |
Protected Member Functions | |
| DtWeatherAreaObjectManager (DtDe &de) | |
Protected Attributes | |
| DtDe & | myDe |
| WeatherAreaMap | myIDToWeatherAreaObjectAgent |
|
protected |
|
virtual |
DTOR.
|
delete |
Default Constructor not implemented - default constructor not allowed.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
protected |
CTOR (protected)
|
delete |
Assignment Operator not implemented - Copy not allowed.
|
static |
Get/create instance of weather area object manager.
|
static |
Get the name this class is registered by.
|
virtual |
Find a weather area object agent, returns null if none exists.
| id | The unique ID of the agent to find. |
|
virtual |
Add a weather area and return its unique id.
|
virtual |
Remove a weather area.
| id | The unique ID of the weather area. |
|
virtual |
Set a weather area's transform.
| id | The unique ID of the weather area. |
| position | The position of the transform. |
| orientation | The orientation of the transform. |
|
virtual |
Set a weather area's bounds.
| id | The unique ID of the weather area. |
| bounds | The (width, length, height) of the bounding box. |
| cornerRadius | The corner radius of the bounding box (for a rounded rect). |
|
virtual |
Set a weather area's precipitation intensity.
| id | The unique ID of the weather area. |
| intensity | The precipitation intensity. |
|
virtual |
Set a weather area's precipitation type.
| id | The unique ID of the weather area. |
| type | The precipitation type (see DtEnvironmentInterface::PrecipitationType). |
|
virtual |
Set a weather area's ground rain accumulation depth.
| id | The unique ID of the weather area. |
| depth | The ground rain accumulation depth. |
|
virtual |
Set a weather area's fog color.
| id | The unique ID of the weather area. |
| color | The fog color (r,g,b) (0.0 - 1.0). |
|
virtual |
Set a weather area's visibility distance.
| id | The unique ID of the weather area. |
| distance | The visibility distance in meters. |
|
virtual |
Set a weather area's overcast lighting value.
| id | The unique ID of the weather area. |
| overcast | The amount of overcast (0.0 [clear] - 1.0 [full overcast]). |
|
virtual |
Set a weather area's lightning enabled value.
| id | The unique ID of the weather area. |
| enabled | Set to true if lightning is enabled. |
|
virtual |
Set a weather area's wind.
| id | The unique ID of the weather area. |
| direction | The wind direction in radians from true north (clockwise). |
| speed | The wind speed in meters per second. |
|
virtual |
Called when a cloud layer is added to a weather area.
| id | The unique ID of the weather area. |
| layerId | The cloud layer id. |
| cloudType | The cloud type (see DtCloudTypeMapper). |
|
virtual |
Called when a cloud layer is removed from a weather area.
| id | The unique ID of the weather area. |
| layerId | The cloud layer id. |
| cloudType | The cloud type (see DtCloudTypeMapper). |
|
virtual |
Query whether the observer is inside any active local weather area that has rain precipitation, and return the blended intensity.
Iterates all managed DtWeatherAreaObject instances. Returns true when the observer is within thePrecipitationQueryEdgeFadeRange of any area whose precipitation type is Rain and intensity > 0. The returned normalizedIntensity is blended linearly from 1.0 (fully inside) to 0.0 at the outer edge of thePrecipitationQueryEdgeFadeRange. When multiple areas qualify, the area with the highest blended intensity wins.
The containment test is a 2D rounded-rectangle check in the XY plane of the database coordinate system, using the area's yaw orientation.
| observerPos | Observer position in the database coordinate system. |
| raining | Set to true when inside a rain area. |
| normalizedIntensity | Set to the blended normalized intensity 0,1. |
|
virtual |
Query whether the observer is inside any active local weather area that has wind, and return the blended wind speed.
Same iteration and blending logic as getLocalPrecipitation but for wind. Returns true when inside any area with windSpeed > 0. The returned speedMs is blended linearly using theWindQueryEdgeFadeRange (100 m).
| observerPos | Observer position in the database coordinate system. |
| audible | Set to true when wind speed is > 0 in a qualifying area. |
| speedMs | Blended wind speed in metres per second. |
| boost::signalslib::signal<void(DtUniqueID id, DtWeatherAreaObject* area)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectAdded |
Signal raised when a weather area is added.
| id | The unique ID of the weather area. |
| area | The the weather area object. |
| boost::signalslib::signal<void(DtUniqueID id, DtWeatherAreaObject* area)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectToBeRemoved |
Signal raised when a weather area is about to be removed.
| id | The unique ID of the weather area. |
| area | The the weather area object. |
| boost::signalslib::signal<void(DtUniqueID id, const DtVector& position, const float orientation)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectTransformChanged |
Signal raised when a weather area transform changes.
| id | The unique ID of the weather area. |
| position | The position of the transform. |
| orientation | The orientation of the transform. |
| boost::signalslib::signal<void(DtUniqueID id, const DtVector& bounds, const float cornerRadius)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectBoundsChanged |
Signal raised when a weather area bounds changes.
| id | The unique ID of the weather area. |
| bounds | The (width, length, height) of the bounding box. |
| cornerRadius | The corner radius of the bounding box (for a rounded rect). |
| boost::signalslib::signal<void(DtUniqueID id, const float intensity)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectPrecipitationIntensityChanged |
Signal raised when a weather area precipitation intensity changes.
| id | The unique ID of the weather area. |
| intensity | The precipitation intensity. |
| boost::signalslib::signal<void(DtUniqueID id, const unsigned int type)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectPrecipitationTypeChanged |
Signal raised when a weather area precipitation type changes.
| id | The unique ID of the weather area. |
| type | The precipitation type (see DtEnvironmentInterface::PrecipitationType). |
| boost::signalslib::signal<void(DtUniqueID id, const float depth)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectGroundRainAccumulationChanged |
Signal raised when a weather area ground rain accumulation changes.
| id | The unique ID of the weather area. |
| depth | The ground rain accumulation depth. |
| boost::signalslib::signal<void(DtUniqueID id, const DtVector& color)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectFogColorChanged |
Signal raised when a weather area fog color changes.
| id | The unique ID of the weather area. |
| color | The fog color (r,g,b) (0.0 - 1.0). |
| boost::signalslib::signal<void(DtUniqueID id, const float distance)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectVisibilityDistanceChanged |
Signal raised when a weather area visibility distance changes.
| id | The unique ID of the weather area. |
| distance | The visibility distance in meters. |
| boost::signalslib::signal<void(DtUniqueID id, const float overcast)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectOvercastChanged |
Signal raised when a weather area overcast changes.
| overcast | The amount of overcast (0.0 [clear] - 1.0 [full overcast]). |
| boost::signalslib::signal<void(DtUniqueID id, const bool enabled)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectLightningEnabledChanged |
Signal raised when a weather area lightning enabled changes.
| enabled | Set to true when lightning is enabled. |
| boost::signalslib::signal<void(DtUniqueID id, const float direction, const float speed)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectWindChanged |
Signal raised when a weather area wind changes.
| id | The unique ID of the weather area. |
| direction | The wind direction in radians from true north (clockwise). |
| speed | The wind speed in meters per second. |
| boost::signalslib::signal<void(DtUniqueID id, DtCloudLayerId layerId, int cloudType)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectCloudLayerAdded |
Signal raised when a weather area adds a cloud layer.
| id | The unique ID of the weather area. |
| layerId | The cloud layer id. |
| cloudType | The cloud type (see DtCloudTypeMapper). |
| boost::signalslib::signal<void(DtUniqueID id, DtCloudLayerId layerId)> makVrv::DtWeatherAreaObjectManager::signal_weatherAreaObjectCloudLayerRemoved |
Signal raised when a weather area removes a cloud layer.
| id | The unique ID of the weather area. |
| layerId | The cloud layer id. |
|
static |
Edge-fade range in metres applied when computing precipitation blending at the boundary of a local weather area. Matches DtWeatherArea::thePrecipitationEdgeFadeRange in vrvOsg.
|
static |
Edge-fade range in metres applied when computing wind blending at the boundary of a local weather area. Matches DtWeatherArea::theWindEdgeFadeRange in vrvOsg.
|
protected |
|
protected |