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 Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtWeatherLayer Class Reference

A weather layer uses one or more weather effects to create a top level visual. More...

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

Public Types

enum  LayerType {
  LayerTypeNone, LayerTypeBlowingDust, LayerTypeBlowingSand, LayerTypeBlowingSnow,
  LayerTypeHail
}
 brief Layer type enumerations. More...
 

Public Member Functions

virtual ~DtWeatherLayer ()
 DTOR. More...
 
virtual void init (DtDe &de)
 Called after creation to initialize effects. More...
 
DtUniqueID id () const
 Gets the layer unique id. More...
 
virtual void releaseGLObjects (osg::State *state) const
 Release all gl objects used by items in this layer. More...
 
virtual DtWeatherLayer::LayerType layerType () const
 Gets a type for this layer. More...
 
virtual void setIntensity (float level)
 Sets the weather intensity for this layer. More...
 
float intensity () const
 Gets the weather intensity for this layer. More...
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 Sets the current wind. More...
 
virtual void simulationUpdate (float timeStep, double currentTime, DtJobSplitter *jobSplitter)
 Run a simulation update for weather effects in this layer. More...
 
virtual void postSimulationUpdate (float timeStep, double currentTime)
 Run a post simulation update. More...
 
virtual void cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &basis, DtJobSplitter *jobSplitter)
 Prepares the layer for drawing based on the camera position. More...
 
virtual void drawWeatherEffects (DtWeatherEffect::DrawData &drawData)
 Draw all weather effects in this layer. More...
 
virtual void addWeatherEffect (DtWeatherEffect *effect)
 Adds the given weather effect to this layer. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Protected Types

typedef std::vector
< DtWeatherEffect * > 
WeatherEffectSet
 This type defines a set of weather effects. More...
 

Protected Member Functions

 DtWeatherLayer (DtUniqueID id)
 CTOR. More...
 
virtual void drawAreaWeatherEffectsForLayerType (DtWeatherEffect::DrawData &drawData, DtWeatherLayer::LayerType layerType)
 Draw all weather effects in areas that match the given layer type. More...
 
virtual void computeSurfaceParameters (DtWeatherEffect::DrawData &drawData, DtWeatherArea *area)
 Computes and sets up effect surface drawing parameters. More...
 

Protected Attributes

DtUniqueID myId
 
LayerType myLayerType
 
WeatherEffectSet myWeatherEffectSet
 
float myIntensity
 

Private Member Functions

 DtWeatherLayer ()=delete
 Default Constructor not implemented. More...
 
 DtWeatherLayer (const DtWeatherLayer &other)=delete
 Copy Constructor not implemented - Copy not allowed. More...
 
DtWeatherLayeroperator= (const DtWeatherLayer &other)=delete
 Assignment Operator not implemented - Assignment not allowed. More...
 

Detailed Description

A weather layer uses one or more weather effects to create a top level visual.

A weather layer simulates an environmental condition such as blowing snow or rain. Weather layers can be globally visible or visible based on weather areas (see DtWeatherArea).

This class has a simulation update which updates all active weather effects in the layer. Weather effects queue update jobs to a job splitter which is provided by the update caller. There is also a post update for each weather effect for items that cannot use multithreading (currently intersection tests).

During scenegraph culling, this class calls cull methods on individual weather effects. If a weather effect is not culled, it submits a sort job to a job splitter

Member Typedef Documentation

This type defines a set of weather effects.

Member Enumeration Documentation

brief Layer type enumerations.

Layer types help with descibing the layer for tying layer to areas.

Enumerator
LayerTypeNone 
LayerTypeBlowingDust 
LayerTypeBlowingSand 
LayerTypeBlowingSnow 
LayerTypeHail 

Constructor & Destructor Documentation

virtual makVrv::DtWeatherLayer::~DtWeatherLayer ( )
virtual

DTOR.

makVrv::DtWeatherLayer::DtWeatherLayer ( DtUniqueID  id)
protected

CTOR.

makVrv::DtWeatherLayer::DtWeatherLayer ( )
privatedelete

Default Constructor not implemented.

makVrv::DtWeatherLayer::DtWeatherLayer ( const DtWeatherLayer other)
privatedelete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtWeatherLayer& makVrv::DtWeatherLayer::operator= ( const DtWeatherLayer other)
privatedelete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtWeatherLayer::init ( DtDe de)
virtual
DtUniqueID makVrv::DtWeatherLayer::id ( ) const

Gets the layer unique id.

virtual void makVrv::DtWeatherLayer::releaseGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by items in this layer.

virtual DtWeatherLayer::LayerType makVrv::DtWeatherLayer::layerType ( ) const
virtual

Gets a type for this layer.

The layer type is used for determining things like tying layers to weather areas.

virtual void makVrv::DtWeatherLayer::setIntensity ( float  level)
virtual

Sets the weather intensity for this layer.

This will control the intensity of weather effects.

Parameters
levelThe intensity value (0.0 - 1.0).
float makVrv::DtWeatherLayer::intensity ( ) const

Gets the weather intensity for this layer.

virtual void makVrv::DtWeatherLayer::setWind ( float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the current wind.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherLayer::simulationUpdate ( float  timeStep,
double  currentTime,
DtJobSplitter jobSplitter 
)
virtual

Run a simulation update for weather effects in this layer.

Parameters
timeStepThe time step to simulate.
currentTimeThe current simulation time.
jobSplitterA job splitter to add simulation jobs to.
virtual void makVrv::DtWeatherLayer::postSimulationUpdate ( float  timeStep,
double  currentTime 
)
virtual

Run a post simulation update.

This is specifically here to update things that might not be job thread safe.

Parameters
timeStepThe time step to simulate.
virtual void makVrv::DtWeatherLayer::cullUpdate ( const osg::Vec3d &  camPos,
const osg::Matrixd &  basis,
DtJobSplitter jobSplitter 
)
virtual

Prepares the layer for drawing based on the camera position.

Parameters
camPosThe camera position.
basisRotThe basis rotation at the camera location.
jobSplitterA job splitter to add predraw jobs to.
virtual void makVrv::DtWeatherLayer::drawWeatherEffects ( DtWeatherEffect::DrawData drawData)
virtual

Draw all weather effects in this layer.

Reimplemented in makVrv::DtWeatherLayerBlowingDust, makVrv::DtWeatherLayerBlowingSand, and makVrv::DtWeatherLayerBlowingSnow.

virtual void makVrv::DtWeatherLayer::addWeatherEffect ( DtWeatherEffect effect)
virtual

Adds the given weather effect to this layer.

Parameters
effectThe effect to add.
virtual void makVrv::DtWeatherLayer::drawAreaWeatherEffectsForLayerType ( DtWeatherEffect::DrawData drawData,
DtWeatherLayer::LayerType  layerType 
)
protectedvirtual

Draw all weather effects in areas that match the given layer type.

Parameters
drawDataThe drawing data that contains areas and data used for drawing.
layerTypeThe desired layer type for matching areas.
virtual void makVrv::DtWeatherLayer::computeSurfaceParameters ( DtWeatherEffect::DrawData drawData,
DtWeatherArea area 
)
protectedvirtual

Computes and sets up effect surface drawing parameters.

Parameters
drawDataThe drawing data structure containing draw parameters.
areaThe area containing a surface.

Member Data Documentation

DtUniqueID makVrv::DtWeatherLayer::myId
protected
LayerType makVrv::DtWeatherLayer::myLayerType
protected
WeatherEffectSet makVrv::DtWeatherLayer::myWeatherEffectSet
protected
float makVrv::DtWeatherLayer::myIntensity
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)