VR-Forces 4.10 Class Documentation
 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. More...

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

Public Member Functions

virtual ~DtWeatherArea ()
 DTOR. More...
 
 DtWeatherArea ()=delete
 Default Constructor not implemented. More...
 
 DtWeatherArea (const DtWeatherArea &other)=delete
 Copy Constructor not implemented - Copy not allowed. More...
 
DtWeatherAreaoperator= (const DtWeatherArea &other)=delete
 Assignment Operator not implemented - Assignment not allowed. More...
 
virtual void setEnabled (bool enabled)
 Enables or disables the weather area. More...
 
virtual bool enabled () const
 Returns the enabled state. More...
 
virtual bool culled () const
 Returns the culled state. More...
 
virtual void setBounds (const DtVector &bounds, float cornerRadius)
 Sets the bounds of the area. More...
 
virtual void setTransform (const DtVector &position, float orientation, bool relativeToCamera=false)
 Sets the area transform. More...
 
virtual const osg::Vec3d & position () const
 Returns the area origin position in world space. More...
 
virtual const osg::Matrixd & rotation () const
 Returns the area origin rotation in world space. More...
 
virtual float boundsX () const
 Returns the bounds X size. More...
 
virtual float boundsY () const
 Returns the bounds Y size. More...
 
virtual float boundsZ () const
 Returns the bounds Z size. More...
 
virtual float boundsCornerRadius () const
 Returns the bounds curner radius. More...
 
virtual const unsigned intpackedData (int &sizeX, int &sizeY) const
 Returns the grid heights/blend packedData array used for terrain clamping. More...
 
virtual void cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &viewMatrixI, const std::vector< osg::Vec4d > &cullingPlanes, DtJobSplitter *jobSplitter)
 Culls the area based on the current camera. More...
 
virtual float computeBoundsDistance2D (const osg::Vec3d &position)
 Computes the xy distance from the given world position to the edge of the bounds. More...
 
virtual float computeBoundsDistance3D (const osg::Vec3d &position)
 Computes the distance from the given world position to the edge of the bounds The bounds is a rounded rect. More...
 
virtual bool usesWeatherLayerType (DtWeatherLayer::LayerType layerType) const
 Returns true if this area uses the give weather layer type. More...
 
virtual void setPrecipitationIntensity (const float intensity)
 Sets a precipitation intensity for the area. More...
 
virtual const float precipitationIntensity () const
 Returns the precipitation intensity for the area. More...
 
virtual void setPrecipitationType (const DtSkyObject::PrecipitationType type)
 Sets a precipitation type for the area. More...
 
virtual const
DtSkyObject::PrecipitationType 
precipitationType () const
 Returns the precipitation type for the area. More...
 
virtual void setGroundRainAccumulation (const float depth)
 Set the ground rain accumulation depth. More...
 
virtual const float groundRainAccumulation () const
 Returns the ground rain accumulation depth. More...
 
virtual void setFogColor (const DtVector &color)
 Sets a fog color for the area. More...
 
virtual const DtVectorfogColor () const
 Returns the fog color for the area. More...
 
virtual void setVisibilityDistance (const float distance)
 Sets a visibility distance for the area. More...
 
virtual const float visibilityDistance () const
 Returns the visibility distance for the area. More...
 
virtual void setOvercast (const float overcast)
 Sets a overcast percentage (lighting) for the area. More...
 
virtual const float overcast () const
 Returns the overcast percentage for the area. More...
 
virtual void setWind (const float windDirectionRad, const float windSpeedMps)
 Sets the current wind. More...
 
virtual void setLightningEnabled (const bool enabled)
 Enables or disables lightning. More...
 
virtual const bool lightningEnabled () const
 Returns true if lightning is enabled for the area. More...
 
virtual bool computeLocalPrecipitation (const osg::Vec3d &location, int &type, float &intensity)
 Computes the precipitation at the given location. More...
 
virtual bool computeLocalGroundRainAccumulation (const osg::Vec3d &location, float &depth, float &blend)
 Computes the ground rain accumulation at the given location. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static float computeBoundsDistance2D (const osg::Vec3d &position, const osg::Vec4d &bounds, const osg::Vec3d &boundsPosition, const osg::Matrixd &boundsRotation)
 Computes the xy distance from the given world position to the edge of the bounds. More...
 
static float computeBoundsDistance3D (const osg::Vec3d &position, const osg::Vec4d &bounds, const osg::Vec3d &boundsPosition, const osg::Matrixd &boundsRotation)
 Computes the distance from the given world position to the edge of the bounds The bounds is a rounded rect with transform at bottom. More...
 

Protected Member Functions

 DtWeatherArea (makVrv::DtDe &de)
 CTOR. More...
 
virtual void updateTransform ()
 Updates the current transform based on current settings. More...
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut) const
 Computes a basis rotation matrix for the given geocentric position. More...
 
virtual bool clampPositionToTerrain (osg::Vec3d &position, float clampDistance) const
 Clamps the given position to the terrain surface. More...
 
virtual bool isSphereVisible (const std::vector< osg::Vec4d > &planes, const osg::Vec3d &center, double radius) const
 Tests to see if a sphere is visible using the given frustum planes. More...
 

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
 

Friends

class DtWeatherAreaFactory
 

Detailed Description

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.

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::DtWeatherAreaBlowingDust, makVrv::DtWeatherAreaBlowingSand, makVrv::DtWeatherAreaBlowingSnow, 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::DtWeatherAreaBlowingDust, makVrv::DtWeatherAreaBlowingSand, makVrv::DtWeatherAreaBlowingSnow, 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::DtWeatherAreaBlowingDust, makVrv::DtWeatherAreaBlowingSand, makVrv::DtWeatherAreaBlowingSnow, 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::DtWeatherAreaBlowingDust, makVrv::DtWeatherAreaBlowingSand, and makVrv::DtWeatherAreaBlowingSnow.

virtual void makVrv::DtWeatherArea::cullUpdate ( const osg::Vec3d &  camPos,
const osg::Matrixd &  viewMatrixI,
const std::vector< osg::Vec4d > &  cullingPlanes,
DtJobSplitter jobSplitter 
)
inlinevirtual

Culls the area based on the current camera.

Parameters
camThe current camera being drawn.
jobSplitterA job splitter to add predraw jobs to.

Reimplemented in makVrv::DtWeatherAreaBlowingDust, makVrv::DtWeatherAreaBlowingSand, makVrv::DtWeatherAreaBlowingSnow, and makVrv::DtWeatherAreaEnvironmental.

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.
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 bool makVrv::DtWeatherArea::usesWeatherLayerType ( DtWeatherLayer::LayerType  layerType) const
virtual

Returns true if this area uses the give weather layer type.

Parameters
layerTypeThe layer type to check.

Reimplemented in makVrv::DtWeatherAreaBlowingDust, makVrv::DtWeatherAreaBlowingSand, makVrv::DtWeatherAreaBlowingSnow, and makVrv::DtWeatherAreaEnvironmental.

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::setWind ( const float  windDirectionRad,
const float  windSpeedMps 
)
virtual

Sets the current wind.

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

Reimplemented in makVrv::DtWeatherAreaEnvironmental.

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 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::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::isSphereVisible ( const std::vector< osg::Vec4d > &  planes,
const osg::Vec3d &  center,
double  radius 
) const
protectedvirtual

Tests to see if a sphere is visible using the given frustum planes.

Parameters
planesThe frustum planes to test the sphere against.
centerThe sphere center position.
radiusthe sphere radius.

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

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)