![]() |
VR-Forces 5.0.3 Developer's Guide
|
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

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 | |
| DtWeatherLayer & | operator= (const DtWeatherLayer &other)=delete |
|
protected |
This type defines a set of weather effects.
|
virtual |
DTOR.
|
protected |
CTOR.
|
privatedelete |
Copy Constructor not implemented - Copy not allowed.
|
privatedelete |
Assignment Operator not implemented - Assignment not allowed.
|
virtual |
Called after creation to initialize effects.
Reimplemented in makVrv::DtWeatherLayerBlowingDust, makVrv::DtWeatherLayerBlowingSand, makVrv::DtWeatherLayerBlowingSnow, and makVrv::DtWeatherLayerHail.
|
virtual |
Release all gl objects used by items in this layer.
|
virtual |
Gets a type for this layer. The layer type is used for determining things like tying layers to weather areas.
|
virtual |
Sets the weather intensity for this layer. This will control the intensity of weather effects.
| level | The intensity value (0.0 - 1.0). |
| float makVrv::DtWeatherLayer::intensity | ( | ) | const |
Gets the weather intensity for this layer.
|
virtual |
Sets the current wind.
| windDirectionRad | The wind direction in radians. |
| windSpeedMps | The wind speed in meters per second. |
|
virtual |
Run a simulation update for weather effects in this layer.
| timeStep | The time step to simulate. |
| currentTime | The current simulation time. |
| jobSplitter | A job splitter to add simulation jobs to. |
|
virtual |
Run a post simulation update. This is specifically here to update things that might not be job thread safe.
| timeStep | The time step to simulate. |
|
virtual |
Prepares the layer for drawing based on the camera position.
| camPos | The camera position. |
| basisRot | The basis rotation at the camera location. |
| jobSplitter | A job splitter to add predraw jobs to. |
|
virtual |
Draw all weather effects in this layer.
| drawData | The data used for drawing. |
|
virtual |
Draw all weather effects in this layer for the given area.
| drawData | The data used for drawing. |
| area | The associated local area to draw the effects for. |
|
virtual |
Adds the given weather effect to this layer.
| effect | The effect to add. |
|
virtual |
Sets the rendering culled state for this layer.
| culled | If true, the object is considered culled. |
|
virtual |
Returns the culled state for this layer.
|
protectedvirtual |
Computes and sets up effect surface drawing parameters.
| drawData | The drawing data structure containing draw parameters. |
| area | The area containing a surface. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |