![]() |
VR-Forces Developer's Guide
|
A weather area represents localized environmental conditions such as blowing dust, blowing sand, or blowing snow. The default (base class) weather area is mainly used as a bounds for localized environmental information such as precipitation intensity. AreaTypeBlowingDust, AreaTypeBlowingSand, AreaTypeBlowingSnow are specialized weather areas that represent 1 specific environmental condition.
Weather areas are used by weather layers to define where layers are active and visible. For example, a blowing snow layer might be active within a weather area bounding volume.
This base class also provides some common utility methods for weather areas.
Various local weather states and settings are tracked by this based class, but the base most likely does not provide any visual effect.

Public Member Functions | |
| virtual | ~DtWeatherArea () |
| DtWeatherArea ()=delete | |
| DtWeatherArea (const DtWeatherArea &other)=delete | |
| DtWeatherArea & | operator= (const DtWeatherArea &other)=delete |
| virtual void | setEnabled (bool enabled) |
| virtual bool | enabled () const |
| virtual bool | culled () const |
| virtual void | setBounds (const DtVector &bounds, float cornerRadius) |
| virtual void | setTransform (const DtVector &position, float orientation, bool relativeToCamera=false) |
| virtual const osg::Vec3d & | position () const |
| virtual const osg::Matrixd & | rotation () const |
| virtual float | boundsX () const |
| virtual float | boundsY () const |
| virtual float | boundsZ () const |
| virtual float | boundsCornerRadius () const |
| virtual const unsigned int * | packedData (int &sizeX, int &sizeY) const |
| virtual void | cullUpdate (const osg::Vec3d &camPos, const Frustum_64 &frustum, DtJobSplitter *jobSplitter, const osg::Camera *camera) |
| virtual void | drawWeatherLayerEffects (DtWeatherEffect::DrawData &drawData) |
| virtual float | computeBoundsDistance2d (const osg::Vec3d &position) |
| virtual float | computeBoundsDistance3d (const osg::Vec3d &position) |
| virtual float | computeBoundsDistance2dAndTop (const osg::Vec3d &position) |
| virtual void | setPrecipitationIntensity (const float intensity) |
| virtual const float | precipitationIntensity () const |
| virtual void | setPrecipitationType (const DtSkyObject::PrecipitationType type) |
| virtual const DtSkyObject::PrecipitationType | precipitationType () const |
| virtual void | setGroundRainAccumulation (const float depth) |
| virtual const float | groundRainAccumulation () const |
| virtual void | setFogColor (const DtVector &color) |
| virtual const DtVector & | fogColor () const |
| virtual void | setVisibilityDistance (const float distance) |
| virtual const float | visibilityDistance () const |
| virtual void | setOvercast (const float overcast) |
| virtual const float | overcast () const |
| virtual void | setGlobalWind (const float windDirectionRad, const float windSpeedMps) |
| virtual void | setWind (const float windDirectionRad, const float windSpeedMps) |
| virtual void | setLightningEnabled (const bool enabled) |
| virtual const bool | lightningEnabled () const |
| virtual void | cloudLayerAdded (DtCloudLayerId layerId, int cloudType) |
| virtual void | cloudLayerRemoved (DtCloudLayerId layerId) |
| virtual bool | computeLocalPrecipitation (const osg::Vec3d &location, int &type, float &intensity) |
| virtual bool | computeLocalGroundRainAccumulation (const osg::Vec3d &location, float &depth, float &blend) |
| virtual void | addWeatherLayer (DtWeatherLayer::LayerType layerType) |
| virtual void | removeWeatherLayer (DtWeatherLayer::LayerType layerType) |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static float | computeBoundsDistance2d (const osg::Vec3d &position, const osg::Vec4d &bounds, const osg::Vec3d &boundsPosition, const osg::Matrixd &boundsRotation) |
| static float | computeBoundsDistance3d (const osg::Vec3d &position, const osg::Vec4d &bounds, const osg::Vec3d &boundsPosition, const osg::Matrixd &boundsRotation) |
| static float | computeBoundsDistance2dAndTop (const osg::Vec3d &position, const osg::Vec4d &bounds, const osg::Vec3d &boundsPosition, const osg::Matrixd &boundsRotation) |
Protected Member Functions | |
| DtWeatherArea (makVrv::DtDe &de) | |
| virtual void | updateTransform () |
| virtual void | computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut) const |
| virtual bool | clampPositionToTerrain (osg::Vec3d &position, float clampDistance) const |
| virtual bool | isPositionBelowSealevel (const DtVector &position) const |
Protected Attributes | |
| DtDe & | myDe |
| bool | myEnabled |
| bool | myCulled |
| DtVector | mySetPosition |
| float | mySetOrientation |
| bool | mySetRelativeToCamera |
| osg::Vec3d | myPosition |
| osg::Matrixd | myRotation |
| float | myBoundsX |
| float | myBoundsY |
| float | myBoundsZ |
| float | myBoundsCornerRadius |
| float | myPrecipitationBoundsScale |
| float | myPrecipitationIntensity |
| DtSkyObject::PrecipitationType | myPrecipitationType |
| float | myGroundRainAccumulation |
| bool | myLightningEnabled |
| DtVector | myFogColor |
| float | myVisibilityDistance |
| float | myOvercast |
| float | myWindDirectionRad |
| float | myWindSpeedMps |
| std::vector< DtWeatherLayer * > | myWeatherLayers |
| DtIntersector * | myIntersector = nullptr |
Friends | |
| class | DtWeatherAreaFactory |
|
virtual |
DTOR.
|
delete |
Default Constructor not implemented.
|
delete |
Copy Constructor not implemented - Copy not allowed.
|
protected |
CTOR.
|
delete |
Assignment Operator not implemented - Assignment not allowed.
|
virtual |
Enables or disables the weather area.
| enabled | Set to true to enable the area. |
Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the enabled state.
|
virtual |
Returns the culled state. For areas that use culling, this will indicate if the area was culled during the last scenegraph culling pass.
|
virtual |
Sets the bounds of the area.
| bounds | The (x,y,z) of the bounds. |
| cornerRadius | The radius at each corner of the bounds. |
Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Sets the area transform.
| position | The transform position in world space. |
| oritantation | The yaw orientation in degrees (0 = north). |
| relativeToCamera | Set to true if the position is relative to the current camera. |
Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the area origin position in world space.
|
virtual |
Returns the area origin rotation in world space.
|
virtual |
Returns the bounds X size.
|
virtual |
Returns the bounds Y size.
|
virtual |
Returns the bounds Z size.
|
virtual |
Returns the bounds curner radius.
|
virtual |
Returns the grid heights/blend packedData array used for terrain clamping.
| sizeX | Filled in output for the grid size in the x direction. |
| sizeY | Filled in output for the grid size in the y direction. |
Reimplemented in makVrv::DtWeatherAreaSurfaceBounds.
|
virtual |
Culls the area based on the current camera. Sets the culled state of any weather layers associated with this area.
| camPos | The current position of the camera being drawn. |
| frustum | The frustum used for culling. |
| jobSplitter | A job splitter to add predraw jobs to. |
| camera | The current camera being drawn. |
Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Draws any active weather layer effects in this area.
| drawData | The drawing data structure containing draw parameters. |
|
static |
Computes the xy distance from the given world position to the edge of the bounds. The bounds is a rounded rect with transform at bottom. Returns 0 if inside.
| position | The world position. |
| bounds | The (width, length, height, corner radius) of the bounds. |
| boundsPosition | The bounds world position. |
| boundRotation | The bounds world rotation. |
|
static |
Computes the distance from the given world position to the edge of the bounds The bounds is a rounded rect with transform at bottom. Returns 0 if inside.
| position | The world position. |
| bounds | The (width, length, height, corner radius) of the bounds. |
| boundsPosition | The bounds world position. |
| boundRotation | The bounds world rotation. |
|
static |
Computes the xy distance from the given world position to the edge of the bounds. Also considers the z distance from the top edge. The bounds is a rounded rect with transform at bottom. Returns 0 if inside.
| position | The world position. |
| bounds | The (width, length, height, corner radius) of the bounds. |
| boundsPosition | The bounds world position. |
| boundRotation | The bounds world rotation. |
|
virtual |
Computes the xy distance from the given world position to the edge of the bounds. The bounds is a rounded rect. Returns 0 if inside.
| position | The world position. |
|
virtual |
Computes the distance from the given world position to the edge of the bounds The bounds is a rounded rect. Returns 0 if inside.
| position | The world position. |
|
virtual |
Computes the xy distance from the given world position to the edge of the bounds. Also considers the z distance from the top edge. The bounds is a rounded rect. Returns 0 if inside.
| position | The world position. |
|
virtual |
Sets a precipitation intensity for the area.
| intensity | The precipitation intensity. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the precipitation intensity for the area.
|
virtual |
Sets a precipitation type for the area.
| type | The precipitation type. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the precipitation type for the area.
|
virtual |
Set the ground rain accumulation depth.
| depth | The ground rain accumulation depth. |
|
virtual |
Returns the ground rain accumulation depth.
|
virtual |
Sets a fog color for the area.
| color | The fog color. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the fog color for the area.
|
virtual |
Sets a visibility distance for the area.
| distance | The distance. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the visibility distance for the area.
|
virtual |
Sets a overcast percentage (lighting) for the area.
| overcast | The overcast percentage value. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns the overcast percentage for the area.
|
virtual |
Sets the current global wind.
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Sets the current local wind.
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
|
virtual |
Enables or disables lightning.
| enabled | Set to true to enable lightning. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Returns true if lightning is enabled for the area.
|
virtual |
Called when a cloud layer has been added to the area.
| layerId | The layer id for the cloud. |
| cloudType | The cloud type (see DtCloudTypeMapper). |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Called when a cloud layer has been removed from the area.
| layerId | The layer id for the cloud. |
Reimplemented in makVrv::DtWeatherAreaEnvironmental.
|
virtual |
Computes the precipitation at the given location. Returns true if location is in this weather area, otherwise false.
| location | The location to compute the precipitation at. |
| type | The computed precipitation type (DtSkyObject::PrecipitationType). |
| intensity | The computed precipitation intensity. |
|
virtual |
Computes the ground rain accumulation at the given location. Returns true if location is in this weather area, otherwise false.
| location | The location to compute the ground rain accumulation at. |
| depth | The computed ground rain accumulation depth. |
| blend | (0.0 to 1.0) blend value based on local area perimeter. |
|
virtual |
Instructs this weather area to add the given weather layer type. This can be used to add area effects such as blowing dust, sand, snow.
| layerType | The layer type to add. |
|
virtual |
Instructs this weather area to remove the given weather layer type. This can be used to remove area effects that were added with addWeatherLayer.
| layerType | The layer type to remove. |
|
protectedvirtual |
Updates the current transform based on current settings.
|
protectedvirtual |
Computes a basis rotation matrix for the given geocentric position.
| inGeocentricPos | The geocentric reference position. |
| rotOut | The computed basis rotation transform. |
|
protectedvirtual |
Clamps the given position to the terrain surface. Returns true if successful.
| position | The input/output position to clamp. |
| clampDistance | The above/below distance to search for a surface. |
|
protectedvirtual |
Returns true if the given position is below sea level.
| position | The location to test. |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |