VR-Forces Developer's Guide
 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.

A weather layer helps simulate an environmental condition such as blowing dust, blowing sand, blowing snow or hail. 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

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

Public Types

enum  LayerType {
  LayerTypeNone, LayerTypeBlowingDust, LayerTypeBlowingSand, LayerTypeBlowingSnow,
  LayerTypeHail
}
 
enum  EffectConstrainType { EffectConstrainType2d, EffectConstrainType3d, EffectConstrainType2dAndTop }
 

Public Member Functions

virtual ~DtWeatherLayer ()
 
virtual void init (DtDe &de)
 
virtual void releaseGLObjects (osg::State *state) const
 
virtual DtWeatherLayer::LayerType layerType () const
 
virtual void setIntensity (float level)
 
float intensity () const
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 
virtual void simulationUpdate (float timeStep, double currentTime, DtJobSplitter *jobSplitter)
 
virtual void postSimulationUpdate (float timeStep, double currentTime)
 
virtual void cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &basis, DtJobSplitter *jobSplitter)
 
virtual void drawWeatherEffects (DtWeatherEffect::DrawData &drawData)
 
virtual void drawAreaWeatherEffects (DtWeatherEffect::DrawData &drawData, DtWeatherArea *area)
 
virtual void addWeatherEffect (DtWeatherEffect *effect)
 
virtual void setCulled (bool culled)
 
virtual bool culled () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Protected Types

typedef std::vector
< DtWeatherEffect * > 
WeatherEffectSet
 

Protected Member Functions

 DtWeatherLayer ()
 
virtual void computeSurfaceParameters (DtWeatherEffect::DrawData &drawData, DtWeatherArea *area)
 

Protected Attributes

LayerType myLayerType
 
WeatherEffectSet myWeatherEffectSet
 
float myIntensity
 
bool myCulled
 
EffectConstrainType myEffectConstrainType
 

Private Member Functions

 DtWeatherLayer (const DtWeatherLayer &other)=delete
 
DtWeatherLayeroperator= (const DtWeatherLayer &other)=delete
 

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 

brief Effect constain type enumerations. Effect constrain types define how layer effects are constrained to an area bounds

Enumerator
EffectConstrainType2d 
EffectConstrainType3d 
EffectConstrainType2dAndTop 

Constructor & Destructor Documentation

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

DTOR.

makVrv::DtWeatherLayer::DtWeatherLayer ( )
protected

CTOR.

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
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.

Parameters
drawDataThe data used for drawing.
virtual void makVrv::DtWeatherLayer::drawAreaWeatherEffects ( DtWeatherEffect::DrawData drawData,
DtWeatherArea area 
)
virtual

Draw all weather effects in this layer for the given area.

Parameters
drawDataThe data used for drawing.
areaThe associated local area to draw the effects for.
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::setCulled ( bool  culled)
virtual

Sets the rendering culled state for this layer.

Parameters
culledIf true, the object is considered culled.
virtual bool makVrv::DtWeatherLayer::culled ( ) const
virtual

Returns the culled state for this layer.

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

LayerType makVrv::DtWeatherLayer::myLayerType
protected
WeatherEffectSet makVrv::DtWeatherLayer::myWeatherEffectSet
protected
float makVrv::DtWeatherLayer::myIntensity
protected
bool makVrv::DtWeatherLayer::myCulled
protected
EffectConstrainType makVrv::DtWeatherLayer::myEffectConstrainType
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)