VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtWeatherArea Class Reference

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.

Inheritance diagram for makVrv::DtWeatherArea:
Inheritance graph
[legend]

Public Member Functions

virtual ~DtWeatherArea ()
 
 DtWeatherArea ()=delete
 
 DtWeatherArea (const DtWeatherArea &other)=delete
 
DtWeatherAreaoperator= (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 intpackedData (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 DtVectorfogColor () 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

DtDemyDe
 
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
 
DtIntersectormyIntersector = nullptr
 

Friends

class DtWeatherAreaFactory
 

Constructor & Destructor Documentation

virtual makVrv::DtWeatherArea::~DtWeatherArea ( )
virtual

DTOR.

makVrv::DtWeatherArea::DtWeatherArea ( )
delete

Default Constructor not implemented.

makVrv::DtWeatherArea::DtWeatherArea ( const DtWeatherArea other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtWeatherArea::DtWeatherArea ( makVrv::DtDe de)
protected

CTOR.

Member Function Documentation

DtWeatherArea& makVrv::DtWeatherArea::operator= ( const DtWeatherArea other)
delete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtWeatherArea::setEnabled ( bool  enabled)
virtual

Enables or disables the weather area.

Parameters
enabledSet to true to enable the area.

Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.

virtual bool makVrv::DtWeatherArea::enabled ( ) const
virtual

Returns the enabled state.

virtual bool makVrv::DtWeatherArea::culled ( ) const
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 void makVrv::DtWeatherArea::setBounds ( const DtVector bounds,
float  cornerRadius 
)
virtual

Sets the bounds of the area.

Parameters
boundsThe (x,y,z) of the bounds.
cornerRadiusThe radius at each corner of the bounds.

Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.

virtual void makVrv::DtWeatherArea::setTransform ( const DtVector position,
float  orientation,
bool  relativeToCamera = false 
)
virtual

Sets the area transform.

Parameters
positionThe transform position in world space.
oritantationThe yaw orientation in degrees (0 = north).
relativeToCameraSet to true if the position is relative to the current camera.

Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.

virtual const osg::Vec3d& makVrv::DtWeatherArea::position ( ) const
virtual

Returns the area origin position in world space.

virtual const osg::Matrixd& makVrv::DtWeatherArea::rotation ( ) const
virtual

Returns the area origin rotation in world space.

virtual float makVrv::DtWeatherArea::boundsX ( ) const
virtual

Returns the bounds X size.

virtual float makVrv::DtWeatherArea::boundsY ( ) const
virtual

Returns the bounds Y size.

virtual float makVrv::DtWeatherArea::boundsZ ( ) const
virtual

Returns the bounds Z size.

virtual float makVrv::DtWeatherArea::boundsCornerRadius ( ) const
virtual

Returns the bounds curner radius.

virtual const unsigned int* makVrv::DtWeatherArea::packedData ( int sizeX,
int sizeY 
) const
virtual

Returns the grid heights/blend packedData array used for terrain clamping.

Parameters
sizeXFilled in output for the grid size in the x direction.
sizeYFilled in output for the grid size in the y direction.

Reimplemented in makVrv::DtWeatherAreaSurfaceBounds.

virtual void makVrv::DtWeatherArea::cullUpdate ( const osg::Vec3d &  camPos,
const Frustum_64 frustum,
DtJobSplitter jobSplitter,
const osg::Camera *  camera 
)
virtual

Culls the area based on the current camera. Sets the culled state of any weather layers associated with this area.

Parameters
camPosThe current position of the camera being drawn.
frustumThe frustum used for culling.
jobSplitterA job splitter to add predraw jobs to.
cameraThe current camera being drawn.

Reimplemented in makVrv::DtWeatherAreaSurfaceBounds, and makVrv::DtWeatherAreaEnvironmental.

virtual void makVrv::DtWeatherArea::drawWeatherLayerEffects ( DtWeatherEffect::DrawData drawData)
virtual

Draws any active weather layer effects in this area.

Parameters
drawDataThe drawing data structure containing draw parameters.
static float makVrv::DtWeatherArea::computeBoundsDistance2d ( const osg::Vec3d &  position,
const osg::Vec4d &  bounds,
const osg::Vec3d &  boundsPosition,
const osg::Matrixd &  boundsRotation 
)
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.

Parameters
positionThe world position.
boundsThe (width, length, height, corner radius) of the bounds.
boundsPositionThe bounds world position.
boundRotationThe bounds world rotation.
static float makVrv::DtWeatherArea::computeBoundsDistance3d ( const osg::Vec3d &  position,
const osg::Vec4d &  bounds,
const osg::Vec3d &  boundsPosition,
const osg::Matrixd &  boundsRotation 
)
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.

Parameters
positionThe world position.
boundsThe (width, length, height, corner radius) of the bounds.
boundsPositionThe bounds world position.
boundRotationThe bounds world rotation.
static float makVrv::DtWeatherArea::computeBoundsDistance2dAndTop ( const osg::Vec3d &  position,
const osg::Vec4d &  bounds,
const osg::Vec3d &  boundsPosition,
const osg::Matrixd &  boundsRotation 
)
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.

Parameters
positionThe world position.
boundsThe (width, length, height, corner radius) of the bounds.
boundsPositionThe bounds world position.
boundRotationThe bounds world rotation.
virtual float makVrv::DtWeatherArea::computeBoundsDistance2d ( const osg::Vec3d &  position)
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.

Parameters
positionThe world position.
virtual float makVrv::DtWeatherArea::computeBoundsDistance3d ( const osg::Vec3d &  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.

Parameters
positionThe world position.
virtual float makVrv::DtWeatherArea::computeBoundsDistance2dAndTop ( const osg::Vec3d &  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.

Parameters
positionThe world position.
virtual void makVrv::DtWeatherArea::setPrecipitationIntensity ( const float  intensity)
virtual

Sets a precipitation intensity for the area.

Parameters
intensityThe precipitation intensity.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual const float makVrv::DtWeatherArea::precipitationIntensity ( ) const
virtual

Returns the precipitation intensity for the area.

virtual void makVrv::DtWeatherArea::setPrecipitationType ( const DtSkyObject::PrecipitationType  type)
virtual

Sets a precipitation type for the area.

Parameters
typeThe precipitation type.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual const DtSkyObject::PrecipitationType makVrv::DtWeatherArea::precipitationType ( ) const
virtual

Returns the precipitation type for the area.

virtual void makVrv::DtWeatherArea::setGroundRainAccumulation ( const float  depth)
virtual

Set the ground rain accumulation depth.

Parameters
depthThe ground rain accumulation depth.
virtual const float makVrv::DtWeatherArea::groundRainAccumulation ( ) const
virtual

Returns the ground rain accumulation depth.

virtual void makVrv::DtWeatherArea::setFogColor ( const DtVector color)
virtual

Sets a fog color for the area.

Parameters
colorThe fog color.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual const DtVector& makVrv::DtWeatherArea::fogColor ( ) const
virtual

Returns the fog color for the area.

virtual void makVrv::DtWeatherArea::setVisibilityDistance ( const float  distance)
virtual

Sets a visibility distance for the area.

Parameters
distanceThe distance.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual const float makVrv::DtWeatherArea::visibilityDistance ( ) const
virtual

Returns the visibility distance for the area.

virtual void makVrv::DtWeatherArea::setOvercast ( const float  overcast)
virtual

Sets a overcast percentage (lighting) for the area.

Parameters
overcastThe overcast percentage value.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual const float makVrv::DtWeatherArea::overcast ( ) const
virtual

Returns the overcast percentage for the area.

virtual void makVrv::DtWeatherArea::setGlobalWind ( const float  windDirectionRad,
const float  windSpeedMps 
)
virtual

Sets the current global wind.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual void makVrv::DtWeatherArea::setWind ( const float  windDirectionRad,
const float  windSpeedMps 
)
virtual

Sets the current local wind.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherArea::setLightningEnabled ( const bool  enabled)
virtual

Enables or disables lightning.

Parameters
enabledSet to true to enable lightning.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual const bool makVrv::DtWeatherArea::lightningEnabled ( ) const
virtual

Returns true if lightning is enabled for the area.

virtual void makVrv::DtWeatherArea::cloudLayerAdded ( DtCloudLayerId  layerId,
int  cloudType 
)
virtual

Called when a cloud layer has been added to the area.

Parameters
layerIdThe layer id for the cloud.
cloudTypeThe cloud type (see DtCloudTypeMapper).

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual void makVrv::DtWeatherArea::cloudLayerRemoved ( DtCloudLayerId  layerId)
virtual

Called when a cloud layer has been removed from the area.

Parameters
layerIdThe layer id for the cloud.

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

virtual bool makVrv::DtWeatherArea::computeLocalPrecipitation ( const osg::Vec3d &  location,
int type,
float &  intensity 
)
virtual

Computes the precipitation at the given location. Returns true if location is in this weather area, otherwise false.

Parameters
locationThe location to compute the precipitation at.
typeThe computed precipitation type (DtSkyObject::PrecipitationType).
intensityThe computed precipitation intensity.
virtual bool makVrv::DtWeatherArea::computeLocalGroundRainAccumulation ( const osg::Vec3d &  location,
float &  depth,
float &  blend 
)
virtual

Computes the ground rain accumulation at the given location. Returns true if location is in this weather area, otherwise false.

Parameters
locationThe location to compute the ground rain accumulation at.
depthThe computed ground rain accumulation depth.
blend(0.0 to 1.0) blend value based on local area perimeter.
virtual void makVrv::DtWeatherArea::addWeatherLayer ( DtWeatherLayer::LayerType  layerType)
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.

Parameters
layerTypeThe layer type to add.
virtual void makVrv::DtWeatherArea::removeWeatherLayer ( DtWeatherLayer::LayerType  layerType)
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.

Parameters
layerTypeThe layer type to remove.
virtual void makVrv::DtWeatherArea::updateTransform ( )
protectedvirtual

Updates the current transform based on current settings.

virtual void makVrv::DtWeatherArea::computeBasis ( const osg::Vec3d &  inGeocentricPos,
osg::Matrixd &  rotOut 
) const
protectedvirtual

Computes a basis rotation matrix for the given geocentric position.

Parameters
inGeocentricPosThe geocentric reference position.
rotOutThe computed basis rotation transform.
virtual bool makVrv::DtWeatherArea::clampPositionToTerrain ( osg::Vec3d &  position,
float  clampDistance 
) const
protectedvirtual

Clamps the given position to the terrain surface. Returns true if successful.

Parameters
positionThe input/output position to clamp.
clampDistanceThe above/below distance to search for a surface.
virtual bool makVrv::DtWeatherArea::isPositionBelowSealevel ( const DtVector position) const
protectedvirtual

Returns true if the given position is below sea level.

Parameters
positionThe location to test.

Friends And Related Function Documentation

friend class DtWeatherAreaFactory
friend

Member Data Documentation

DtDe& makVrv::DtWeatherArea::myDe
protected
bool makVrv::DtWeatherArea::myEnabled
protected
bool makVrv::DtWeatherArea::myCulled
protected
DtVector makVrv::DtWeatherArea::mySetPosition
protected
float makVrv::DtWeatherArea::mySetOrientation
protected
bool makVrv::DtWeatherArea::mySetRelativeToCamera
protected
osg::Vec3d makVrv::DtWeatherArea::myPosition
protected
osg::Matrixd makVrv::DtWeatherArea::myRotation
protected
float makVrv::DtWeatherArea::myBoundsX
protected
float makVrv::DtWeatherArea::myBoundsY
protected
float makVrv::DtWeatherArea::myBoundsZ
protected
float makVrv::DtWeatherArea::myBoundsCornerRadius
protected
float makVrv::DtWeatherArea::myPrecipitationBoundsScale
protected
float makVrv::DtWeatherArea::myPrecipitationIntensity
protected
DtSkyObject::PrecipitationType makVrv::DtWeatherArea::myPrecipitationType
protected
float makVrv::DtWeatherArea::myGroundRainAccumulation
protected
bool makVrv::DtWeatherArea::myLightningEnabled
protected
DtVector makVrv::DtWeatherArea::myFogColor
protected
float makVrv::DtWeatherArea::myVisibilityDistance
protected
float makVrv::DtWeatherArea::myOvercast
protected
float makVrv::DtWeatherArea::myWindDirectionRad
protected
float makVrv::DtWeatherArea::myWindSpeedMps
protected
std::vector<DtWeatherLayer*> makVrv::DtWeatherArea::myWeatherLayers
protected
DtIntersector* makVrv::DtWeatherArea::myIntersector = nullptr
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)