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 | Protected Member Functions | Protected Attributes | Friends
makVrv::DtWeatherAreaEnvironmental Class Reference

Used by the weather system to define an environmental area. These areas can contain items such as precipitation and fog.

A environment weather area is created using the following: DtWeatherAreaFactory::instance(myDe).create(DtWeatherAreaFactory::AreaTypeEnvironmental)

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

Public Member Functions

virtual ~DtWeatherAreaEnvironmental ()
 
 DtWeatherAreaEnvironmental ()=delete
 
 DtWeatherAreaEnvironmental (const DtWeatherAreaEnvironmental &other)=delete
 
DtWeatherAreaEnvironmentaloperator= (const DtWeatherAreaEnvironmental &other)=delete
 
virtual void setEnabled (bool enabled)
 
virtual void setBounds (const DtVector &bounds, float cornerRadius)
 
virtual void setTransform (const DtVector &position, float orientation, bool relativeToCamera=false)
 
virtual void cullUpdate (const osg::Vec3d &camPos, const Frustum_64 &frustum, DtJobSplitter *jobSplitter, const osg::Camera *camera) override
 
virtual void setPrecipitationIntensity (const float intensity)
 
virtual void setPrecipitationType (const DtSkyObject::PrecipitationType type)
 
virtual void setFogColor (const DtVector &color)
 
virtual void setVisibilityDistance (const float distance)
 
virtual void setOvercast (const float overcast)
 
virtual void setGlobalWind (const float windDirectionRad, const float windSpeedMps)
 
virtual void setLightningEnabled (const bool enabled)
 
virtual void cloudLayerAdded (DtCloudLayerId layerId, int cloudType)
 
virtual void cloudLayerRemoved (DtCloudLayerId layerId)
 
- Public Member Functions inherited from makVrv::DtWeatherArea
virtual ~DtWeatherArea ()
 
 DtWeatherArea ()=delete
 
 DtWeatherArea (const DtWeatherArea &other)=delete
 
DtWeatherAreaoperator= (const DtWeatherArea &other)=delete
 
virtual bool enabled () const
 
virtual bool culled () const
 
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 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 const float precipitationIntensity () const
 
virtual const
DtSkyObject::PrecipitationType 
precipitationType () const
 
virtual void setGroundRainAccumulation (const float depth)
 
virtual const float groundRainAccumulation () const
 
virtual const DtVectorfogColor () const
 
virtual const float visibilityDistance () const
 
virtual const float overcast () const
 
virtual void setWind (const float windDirectionRad, const float windSpeedMps)
 
virtual const bool lightningEnabled () const
 
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 ()
 

Protected Member Functions

 DtWeatherAreaEnvironmental (makVrv::DtDe &de)
 
virtual void computePrecipitationShaftBounds (osg::Vec3d &position, DtVector &bounds, float &cornerRadius)
 
virtual void computeHeightFogBounds (DtVector &bounds, double &cornerRadius)
 
virtual void onAreaChanged ()
 
virtual float computeFogDensity (const float precipitaionIintensity, const float distance) const
 
virtual void computePrecipitationShaftBaseColor (DtVector &color)
 
virtual void initPrecipitationItems (DtWeatherAreaGroup *areaGroup, bool lightning)
 
virtual void updateHeightFogLighting (const osg::Camera *osgCamera)
 
virtual void slot_simulationUpdate ()
 
virtual void slot_coordinateSystemChanged ()
 
- Protected Member Functions inherited from makVrv::DtWeatherArea
 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

DtSignalConnectionManager myConnections
 
DtUniqueID myPrecipitationShaftId
 
DtUniqueID myHeightFogId
 
DtUniqueID myLightningId
 
DtVector myHeightFogColor
 
std::vector< DtCloudLayerIdmyWindCloudLayers
 
DtCoordinateSystemmyCoordinateSystem = nullptr
 
- Protected Attributes inherited from makVrv::DtWeatherArea
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
 

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtWeatherArea
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)
 

Constructor & Destructor Documentation

virtual makVrv::DtWeatherAreaEnvironmental::~DtWeatherAreaEnvironmental ( )
virtual

DTOR.

makVrv::DtWeatherAreaEnvironmental::DtWeatherAreaEnvironmental ( )
delete

Default Constructor not implemented.

makVrv::DtWeatherAreaEnvironmental::DtWeatherAreaEnvironmental ( const DtWeatherAreaEnvironmental other)
delete

Copy Constructor not implemented - Copy not allowed.

makVrv::DtWeatherAreaEnvironmental::DtWeatherAreaEnvironmental ( makVrv::DtDe de)
protected

CTOR.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

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

Enables or disables the weather area.

Parameters
enabledSet to true to enable the area.

Reimplemented from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::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 from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::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 from makVrv::DtWeatherArea.

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

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 from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::setPrecipitationIntensity ( const float  intensity)
virtual

Sets a precipitation intensity for the area.

Parameters
intensityThe precipitation intensity.

Reimplemented from makVrv::DtWeatherArea.

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

Sets a precipitation type for the area. This will in turn enable visual environmental effects such as height fog and precipitation shafts which are modified by environmental conditions such as visibility and fog color.

Note that this does not create particle droplets close to the eye such as rain drops, as those effects are handled by Silverlining.

Parameters
typeThe precipitation type.

Reimplemented from makVrv::DtWeatherArea.

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

Sets a fog color for the area.

Parameters
colorThe fog color.

Reimplemented from makVrv::DtWeatherArea.

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

Sets a visibility distance for the area.

Parameters
distanceThe distance.

Reimplemented from makVrv::DtWeatherArea.

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

Sets a overcast (lighting) for the area.

Parameters
overcastThe overcast value.

Reimplemented from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::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 from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::setLightningEnabled ( const bool  enabled)
virtual

Enables or disables lightning.

Parameters
enabledSet to true to enable lightning.

Reimplemented from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::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 from makVrv::DtWeatherArea.

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

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

Parameters
layerIdThe layer id for the cloud.

Reimplemented from makVrv::DtWeatherArea.

virtual void makVrv::DtWeatherAreaEnvironmental::computePrecipitationShaftBounds ( osg::Vec3d &  position,
DtVector bounds,
float &  cornerRadius 
)
protectedvirtual

Computes the bounds specifically for a precipitation haft.

Parameters
positionThe computed output bounds origin.
boundsThe computed output (width, length, height) bounds.
cornerRadiusThe computed output bounds corner radius.
virtual void makVrv::DtWeatherAreaEnvironmental::computeHeightFogBounds ( DtVector bounds,
double cornerRadius 
)
protectedvirtual

Computes the bounds for height fog to visually match the current area bounds.

Parameters
boundsThe computed output (width, length, height) bounds.
cornerRadiusThe computed output bounds corner radius.
virtual void makVrv::DtWeatherAreaEnvironmental::onAreaChanged ( )
protectedvirtual

Called when the area bounds or transform has changed.

virtual float makVrv::DtWeatherAreaEnvironmental::computeFogDensity ( const float  precipitaionIintensity,
const float  distance 
) const
protectedvirtual

Computes a fog density from the given precipitation intensity and visibility distance values.

Parameters
intensityThe precipitation intensity.
distanceThe visibility distance.
virtual void makVrv::DtWeatherAreaEnvironmental::computePrecipitationShaftBaseColor ( DtVector color)
protectedvirtual

Computes a precipitation shaft base color based on current overcast value.

Parameters
colorThe computed output rgb (0.0 - 1.0 scale).
virtual void makVrv::DtWeatherAreaEnvironmental::initPrecipitationItems ( DtWeatherAreaGroup areaGroup,
bool  lightning 
)
protectedvirtual

Initializes environmental items used by precipitation. see setPrecipitationType for more details.

Parameters
areaGroupThe area group to add items to.
lightningIf lightning should be included.
virtual void makVrv::DtWeatherAreaEnvironmental::updateHeightFogLighting ( const osg::Camera *  osgCamera)
protectedvirtual

Updates active height fog color based on the current lighting conditions.

virtual void makVrv::DtWeatherAreaEnvironmental::slot_simulationUpdate ( )
protectedvirtual

Signal handler to run a simulation update.

virtual void makVrv::DtWeatherAreaEnvironmental::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

Friends And Related Function Documentation

friend class DtWeatherAreaFactory
friend

Member Data Documentation

DtSignalConnectionManager makVrv::DtWeatherAreaEnvironmental::myConnections
protected
DtUniqueID makVrv::DtWeatherAreaEnvironmental::myPrecipitationShaftId
protected
DtUniqueID makVrv::DtWeatherAreaEnvironmental::myHeightFogId
protected
DtUniqueID makVrv::DtWeatherAreaEnvironmental::myLightningId
protected
DtVector makVrv::DtWeatherAreaEnvironmental::myHeightFogColor
protected
std::vector<DtCloudLayerId> makVrv::DtWeatherAreaEnvironmental::myWindCloudLayers
protected
DtCoordinateSystem* makVrv::DtWeatherAreaEnvironmental::myCoordinateSystem = nullptr
protected

local clone of the system wide coordinate system. for thread safety.


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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)