VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes
makVrv::DtWeatherAreaGroup Class Reference

A group node which serves as a root for weather areas, patchy ground fog areas and effects, infinite height fog, sandstorms, precipitation shafts, and lightning.

A special note that sandstorms rely heavily on ground fog and ground fog effects. Sandstorms are achieved using various ground fog and effect configurations such as base color modification and local dust eye effects.

This group node is the top level node in the scenegraph for ground fog. The node also serves as the main interface to create and modify ground fog layers. All ground fog areas share a material state and all ground fog effects share a material state. Infinite height fog management is handled directly in this class.

This class manages weather areas (DtWeatherArea) such as blowing dust, blowing sand, and blowing snow.

This class also handles signals from weather area objects. These objects are generally come from DtLocalEnvironmentalsControllerObject which processes data for local weather area entities.

During the cull phase, draw items such as ground fog areas, ground fog area effects, and precipitation shafts, are all placed in draw sort bins (pre-clouds, post clouds, or transparent) depending on the desired sorting for a painters algorithm. Three osg drawables are placed in the scenegraph to hook into (pre-clouds, post clouds, or transparent) drawImplementation callbacks. Each draw implementation callback will flush the appropriate sorting bin.

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

Classes

struct  DrawItem
 
struct  DrawItemSortDistanceComparator
 
struct  GroundFogEffectState
 
struct  GroundFogPatchState
 
struct  HeightFogItem
 
struct  LightningState
 
struct  PrecipitationShaftState
 
struct  SoftnessUniforms
 

Public Types

enum  SensorMaterialType {
  SensorMaterialTypeNone = 0, SensorMaterialTypePatchyGroundFog, SensorMaterialTypeSandstorm, SensorMaterialTypeSandstormEffect,
  SensorMaterialTypePrecipitationShaft, SensorMaterialTypeLightning, SensorMaterialTypeCount
}
 
enum  DrawItemType {
  DrawItemTypeNone = 0, DrawItemTypeGroundFogPatchArea, DrawItemTypeGroundFogEffect, DrawItemTypePrecipitationShaft,
  DrawItemTypeLightning
}
 

Public Member Functions

 DtWeatherAreaGroup (DtDe &de)
 
 DtWeatherAreaGroup (const DtWeatherAreaGroup &orig, const osg::CopyOp &opr)
 
virtual ~DtWeatherAreaGroup ()
 
 DtWeatherAreaGroup ()=delete
 
 DtWeatherAreaGroup (const DtWeatherAreaGroup &other)=delete
 
DtWeatherAreaGroupoperator= (const DtWeatherAreaGroup &other)=delete
 
virtual void init ()
 
virtual void releaseGLObjects (osg::State *state=0) const override
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 
virtual osg::Object * cloneType () const
 
virtual void deleteGeode ()
 
virtual osg::Node * getOrCreateSensorNode (SensorMaterialType matType)
 
virtual void removeCloudLayer (DtCloudLayerId layerId)
 
virtual bool removeHeightFog (DtUniqueID uniqueId)
 
virtual void removeCloudLayers ()
 
virtual void addGroundFog (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool infinite, bool relative, bool altitudeIsHAT)
 
virtual DtUniqueID addHeightFog (const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool relative)
 
virtual void addPatchyGroundFog (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool relative)
 
virtual void addSandstorm (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool infinite, bool relative, bool altitudeIsHAT)
 
virtual void addBlowingDustArea (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, bool relative)
 
virtual void addBlowingSandArea (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, bool relative)
 
virtual void addBlowingSnowArea (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, bool relative)
 
virtual DtUniqueID addPrecipitationShaft (osg::Vec3d &position, const osg::Matrixd &rotation, const DtVector &bounds, const float cornerRadius, const float intensity)
 
virtual void removePrecipitationShaft (DtUniqueID uniqueId)
 
virtual void setWeatherPrecipitationShaftBounds (DtUniqueID uniqueId, const DtVector &bounds, const float cornerRadius)
 
virtual void setWeatherPrecipitationShaftTransform (DtUniqueID uniqueId, const osg::Vec3d &position, const osg::Matrixd &rotation)
 
virtual void setWeatherPrecipitationShaftIntensity (DtUniqueID uniqueId, const float intensity)
 
virtual void setWeatherPrecipitationShaftBaseColor (DtUniqueID uniqueId, const DtVector &color)
 
virtual void setWeatherPrecipitationShaftWind (DtUniqueID uniqueId, const float windDirectionRad, const float windSpeedMps)
 
virtual void setWeatherPrecipitationShaftEnabled (DtUniqueID uniqueId, bool enabled)
 
virtual DtUniqueID addLightning (osg::Vec3d &position, const osg::Matrixd &rotation, const DtVector &bounds, const float cornerRadius, const float intensity)
 
virtual void removeLightning (DtUniqueID uniqueId)
 
virtual void setWeatherLightningBounds (DtUniqueID uniqueId, const DtVector &bounds, const float cornerRadius)
 
virtual void setWeatherLightningTransform (DtUniqueID uniqueId, const osg::Vec3d &position, const osg::Matrixd &rotation)
 
virtual void setWeatherLightningIntensity (DtUniqueID uniqueId, const float intensity)
 
virtual void setWeatherLightningEnabled (DtUniqueID uniqueId, bool enabled)
 
virtual void setCloudLayerDensity (DtCloudLayerId layerId, float density)
 
virtual void setHeightFogDensity (DtUniqueID uniqueId, float density)
 
virtual void setCloudLayerEnabled (DtCloudLayerId layerId, bool enabled)
 
virtual void setHeightFogEnabled (DtUniqueID uniqueId, bool enabled)
 
virtual void setCloudLayerPositionAndOrientation (DtCloudLayerId layerId, const DtVector &position, float orientation)
 
virtual void setHeightFogPositionAndOrientation (DtUniqueID uniqueId, const DtVector &position, float orientation, bool relative)
 
virtual void setCloudLayerBaseColor (DtCloudLayerId layerId, float red, float green, float blue)
 
virtual void setHeightFogBaseColor (DtUniqueID uniqueId, float red, float green, float blue)
 
virtual void setHeightFogBounds (DtUniqueID uniqueId, const DtVector &bounds, const float cornerRadius)
 
virtual void setCloudLayerParticleSizeVariation (DtCloudLayerId layerId, float variation)
 
virtual void setCloudLayerPatternedLook (DtCloudLayerId layerId, bool patternedEnable)
 
virtual void setCloudLayerWind (DtCloudLayerId layerId, float windDirectionRad, float windSpeedMps)
 
virtual void setGlobalWind (float windDirectionRad, float windSpeedMps)
 
virtual void drawObjects (osg::RenderInfo &renderInfo, const DtWeatherAreaDrawable &drawable)
 
virtual void gatherWeatherAreas (const osg::Vec3d &position, std::vector< DtWeatherArea * > &areas)
 
virtual bool computeLocalPrecipitation (const DtVector &location, int &precipType, float &intensity)
 
virtual bool computeLocalGroundRainAccumulation (const DtVector &location, float &depth, float &blend)
 
virtual bool shouldActivateRaindrops () const
 
virtual bool bindFogFroxelTexture (const int unit, const unsigned int renderContextId)
 
virtual float fogFroxelMaxDistance () const
 

Protected Types

typedef std::map< DtUniqueID,
HeightFogItem
DtHeightFogMap
 
typedef std::map
< DtCloudLayerId, DtUniqueID
DtCloudLayerIdToUniqueIdMap
 

Protected Member Functions

virtual void initGroundFogPatchState ()
 
virtual void initSandstormState ()
 
virtual void initGroundFogEffectState ()
 
virtual void initPrecipitationShaftState ()
 
virtual void initLightningState ()
 
virtual void loadShaders ()
 
virtual void loadGroundFogPatchShaders ()
 
virtual void loadSandstormShaders ()
 
virtual void loadGroundFogEffectShaders ()
 
virtual void loadPrecipitationShaftShaders ()
 
virtual void loadLightningShaders ()
 
virtual void clearDrawBins ()
 
void flushDrawBin (osg::RenderInfo &renderInfo, const DtWeatherAreaDrawable &drawable, std::vector< DrawItem > &drawBin)
 
virtual void drawGroundFogPatchArea (DtGroundFogPatchArea::DrawData &drawData, DtGroundFogPatchArea *area, const bool stateDirty)
 
virtual void drawGroundFogEffect (DtGroundFogEffect::DrawData &drawData, DtGroundFogPatchArea *area, const bool stateDirty)
 
virtual void drawPrecipitationShaft (DtWeatherPrecipitationShaft::DrawData &drawData, DtWeatherPrecipitationShaft *shaft, const bool stateDirty)
 
virtual void drawLightning (DtWeatherLightning::DrawData &drawData, DtWeatherLightning *lightning, const bool stateDirty)
 
virtual void applyState (DtGroundFogPatchArea::DrawData &drawData, GroundFogPatchState &mutableState) const
 
virtual void applyState (DtGroundFogEffect::DrawData &drawData) const
 
virtual void applyState (DtWeatherPrecipitationShaft::DrawData &drawData) const
 
virtual void applyState (DtWeatherLightning::DrawData &drawData) const
 
virtual void initSoftnessUniforms (osg::StateSet &ss, SoftnessUniforms &softnessUniforms)
 
virtual void setupSoftness (osg::Camera *camera, SoftnessUniforms &softnessUniforms) const
 
void connectSignals ()
 
virtual void slot_reloadShaders ()
 
virtual void slot_simulationUpdate ()
 
virtual void slot_weatherAreaObjectAdded (DtUniqueID id, DtWeatherAreaObject *)
 
virtual void slot_weatherAreaObjectToBeRemoved (DtUniqueID id, DtWeatherAreaObject *)
 
virtual void slot_weatherAreaObjectTransformChanged (DtUniqueID id, const DtVector &position, const float orientation)
 
virtual void slot_weatherAreaObjectBoundsChanged (DtUniqueID id, const DtVector &bounds, const float cornerRadius)
 
virtual void slot_weatherAreaObjectPrecipitationIntensityChanged (DtUniqueID id, const float intensity)
 
virtual void slot_weatherAreaObjectPrecipitationTypeChanged (DtUniqueID id, const unsigned int type)
 
virtual void slot_weatherAreaObjectGroundRainAccumulationChanged (DtUniqueID id, const float depth)
 
virtual void slot_weatherAreaObjectFogColorChanged (DtUniqueID id, const DtVector &color)
 
virtual void slot_weatherAreaObjectVisibilityDistanceChanged (DtUniqueID id, const float distance)
 
virtual void slot_weatherAreaObjectOvercastChanged (DtUniqueID id, const float distance)
 
virtual void slot_weatherAreaObjectLightningEnabledChanged (DtUniqueID id, const bool enabled)
 
virtual void slot_weatherAreaObjectWindChanged (DtUniqueID id, const float direction, const float speed)
 
virtual void slot_weatherAreaObjectCloudLayerAdded (DtUniqueID id, DtCloudLayerId layerId, int cloudType)
 
virtual void slot_weatherAreaObjectCloudLayerRemoved (DtUniqueID id, DtCloudLayerId layerId)
 
virtual void traverse (osg::NodeVisitor &nv)
 
virtual void disableHeightFog ()
 
virtual void cullUpdate (osg::Camera *cam)
 
virtual void cullUpdateHeightFog (osg::Camera *cam)
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut)
 
virtual void releaseGroundFogPatchGLObjects (osg::State *state) const
 
virtual void releaseGroundFogEffectGLObjects (osg::State *state) const
 
virtual void releaseWeatherPrecipitationShaftGLObjects (osg::State *state) const
 
virtual void releaseWeatherLightningGLObjects (osg::State *state) const
 

Protected Attributes

DtDemyDe
 
float myWindSpeedMps
 
float myWindDirectionRad
 
osg::ref_ptr< osg::Node > mySensorNodes [SensorMaterialTypeCount]
 
osg::ref_ptr< osg::Group > mySortPreCloudsGroupNode
 
osg::ref_ptr< osg::Geode > mySortPreCloudsGeode
 
osg::ref_ptr
< makVrv::DtWeatherAreaDrawable
mySortPreCloudsDrawable
 
osg::ref_ptr< osg::Group > mySortPostCloudsGroupNode
 
osg::ref_ptr< osg::Geode > mySortPostCloudsGeode
 
osg::ref_ptr
< makVrv::DtWeatherAreaDrawable
mySortPostCloudsDrawable
 
osg::ref_ptr< osg::Group > mySortTransparentGroupNode
 
osg::ref_ptr< osg::Geode > mySortTransparentGeode
 
osg::ref_ptr
< makVrv::DtWeatherAreaDrawable
mySortTransparentDrawable
 
osg::ref_ptr< osg::Group > myGroundFogPatchSensorGroup
 
osg::ref_ptr< osg::Group > mySandstormSensorGroup
 
osg::ref_ptr< osg::Group > myGroundFogEffectSensorGroup
 
osg::ref_ptr< osg::Group > myWeatherPrecipitationShaftSensorGroup
 
osg::ref_ptr< osg::Group > myWeatherLightningSensorGroup
 
std::vector< DrawItemmyPreSortBin
 
std::vector< DrawItemmySortBinPreClouds
 
std::vector< DrawItemmySortBinPostClouds
 
std::vector< DrawItemmySortBinTransparent
 
GroundFogPatchState myMutableGroundFogPatchState
 
GroundFogPatchState myMutableSandstormState
 
GroundFogEffectState myMutableGroundFogEffectState
 
PrecipitationShaftState myMutablePrecipitationShaftState
 
LightningState myMutableLightningState
 
DtHeightFogMap myHeightFogMap
 
DtCloudLayerIdToUniqueIdMap myCloudLayerIdToUniqueIdMap
 
std::vector< osg::Vec4d > myCullingPlanes
 
double myLastTime
 
float myTimeStep
 
DtJobSplittermyJobSplitter
 
DtSignalConnectionManager myConnections
 
DtWeatherFogFroxelGridmyWeatherFogFroxelGrid
 

Private Types

typedef std::map
< DtCloudLayerId,
DtGroundFogPatchArea * > 
DtGroundFogPatchAreaMap
 
typedef std::map
< DtCloudLayerId,
DtWeatherArea * > 
DtWeatherAreaMap
 
typedef std::map< DtUniqueID,
DtWeatherArea * > 
DtWeatherAreaObjectMap
 
typedef std::map< DtUniqueID,
DtWeatherPrecipitationShaft * > 
DtWeatherPrecipitationShaftMap
 
typedef std::map< DtUniqueID,
DtWeatherLightning * > 
DtWeatherLightningMap
 

Private Member Functions

osg::Node * getChildNodeByName (osg::Group *parent, const char *name)
 

Private Attributes

DtGroundFogPatchAreaMap myMutableGroundFogPatchAreaMap
 
DtWeatherAreaMap myMutableWeatherAreaMap
 
DtWeatherAreaObjectMap myMutableWeatherAreaObjectMap
 
DtWeatherPrecipitationShaftMap myMutableWeatherPrecipitationShaftMap
 
DtWeatherLightningMap myMutableWeatherLightningMap
 

Member Typedef Documentation

This is mutable because it's used as part of the const drawImplementation.

This is mutable because it's used as part of the const drawImplementation.

This is mutable because it's used as part of the const drawImplementation.

This is mutable because it's used as part of the const drawImplementation.

This is mutable because it's used as part of the const drawImplementation.

Member Enumeration Documentation

brief Sensor material type enumerations used for sensorfx.

Enumerator
SensorMaterialTypeNone 
SensorMaterialTypePatchyGroundFog 
SensorMaterialTypeSandstorm 
SensorMaterialTypeSandstormEffect 
SensorMaterialTypePrecipitationShaft 
SensorMaterialTypeLightning 
SensorMaterialTypeCount 

brief Draw item type enumerations used for sorting bins.

Enumerator
DrawItemTypeNone 
DrawItemTypeGroundFogPatchArea 
DrawItemTypeGroundFogEffect 
DrawItemTypePrecipitationShaft 
DrawItemTypeLightning 

Constructor & Destructor Documentation

makVrv::DtWeatherAreaGroup::DtWeatherAreaGroup ( DtDe de)

CTOR.

makVrv::DtWeatherAreaGroup::DtWeatherAreaGroup ( const DtWeatherAreaGroup orig,
const osg::CopyOp &  opr 
)

Copy constructor needed because it is derived from osg::Group.

virtual makVrv::DtWeatherAreaGroup::~DtWeatherAreaGroup ( )
virtual

DTOR.

makVrv::DtWeatherAreaGroup::DtWeatherAreaGroup ( )
delete

Default Constructor not implemented.

makVrv::DtWeatherAreaGroup::DtWeatherAreaGroup ( const DtWeatherAreaGroup other)
delete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtWeatherAreaGroup::init ( )
virtual

Called from the creator to initialize the object.

virtual void makVrv::DtWeatherAreaGroup::releaseGLObjects ( osg::State *  state = 0) const
overridevirtual

release gl for fog patch and fog effect

virtual osg::Object* makVrv::DtWeatherAreaGroup::clone ( const osg::CopyOp &  copyop) const
inlinevirtual

required functions for derriving from osg::Group

virtual osg::Object* makVrv::DtWeatherAreaGroup::cloneType ( ) const
inlinevirtual
virtual void makVrv::DtWeatherAreaGroup::deleteGeode ( )
virtual

Tell the group to delete its specific children.

virtual osg::Node* makVrv::DtWeatherAreaGroup::getOrCreateSensorNode ( SensorMaterialType  matType)
virtual
virtual void makVrv::DtWeatherAreaGroup::removeCloudLayer ( DtCloudLayerId  layerId)
virtual

Remove a cloud layer.

virtual bool makVrv::DtWeatherAreaGroup::removeHeightFog ( DtUniqueID  uniqueId)
virtual

Remove a height fog object. Returns true if the object was found and removed.

virtual void makVrv::DtWeatherAreaGroup::removeCloudLayers ( )
virtual

Remove all the cloud decks.

virtual void makVrv::DtWeatherAreaGroup::addGroundFog ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
double  density,
bool  infinite,
bool  relative,
bool  altitudeIsHAT 
)
virtual

Adds a ground fog layer.

virtual DtUniqueID makVrv::DtWeatherAreaGroup::addHeightFog ( const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
double  density,
bool  relative 
)
virtual

Adds a height fog object. Returns a unique id for the added object.

virtual void makVrv::DtWeatherAreaGroup::addPatchyGroundFog ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
double  density,
bool  relative 
)
virtual

Adds a patchy ground fog area.

virtual void makVrv::DtWeatherAreaGroup::addSandstorm ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
double  density,
bool  infinite,
bool  relative,
bool  altitudeIsHAT 
)
virtual

Adds a sandstorm layer.

virtual void makVrv::DtWeatherAreaGroup::addBlowingDustArea ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
bool  relative 
)
virtual

Adds a blowing dust area.

virtual void makVrv::DtWeatherAreaGroup::addBlowingSandArea ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
bool  relative 
)
virtual

Adds a blowing sand area.

virtual void makVrv::DtWeatherAreaGroup::addBlowingSnowArea ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
bool  relative 
)
virtual

Adds a blowing snow area.

virtual DtUniqueID makVrv::DtWeatherAreaGroup::addPrecipitationShaft ( osg::Vec3d &  position,
const osg::Matrixd &  rotation,
const DtVector bounds,
const float  cornerRadius,
const float  intensity 
)
virtual

Adds a precipitation shaft. Returns a unique id for the added object.

Parameters
positionThe object transform position.
rotationThe object transform rotation.
boundsThe width, length, height of the bounds.
cornerRadiusThe corner radius of the bounds: must be <= min(width, length)
intensityThe intensity (affects visibility).
virtual void makVrv::DtWeatherAreaGroup::removePrecipitationShaft ( DtUniqueID  uniqueId)
virtual

Remove a precipitation shaft.

Parameters
uniqueIdThe precipitation shaft object id.
virtual void makVrv::DtWeatherAreaGroup::setWeatherPrecipitationShaftBounds ( DtUniqueID  uniqueId,
const DtVector bounds,
const float  cornerRadius 
)
virtual

Sets the bounds for a precipitation shaft object.

Parameters
uniqueIdThe precipitation shaft object id.
boundsThe width, length, height of the bounds.
cornerRadiusThe corner radius of the bounds: must be <= min(width, length)
virtual void makVrv::DtWeatherAreaGroup::setWeatherPrecipitationShaftTransform ( DtUniqueID  uniqueId,
const osg::Vec3d &  position,
const osg::Matrixd &  rotation 
)
virtual

Sets the position and rotation for a precipitation shaft object.

Parameters
uniqueIdThe precipitation shaft object id.
positionThe object transform position.
rotationThe object transform rotation.
virtual void makVrv::DtWeatherAreaGroup::setWeatherPrecipitationShaftIntensity ( DtUniqueID  uniqueId,
const float  intensity 
)
virtual

brief Set the intensity for a precipitation shaft object.

Parameters
uniqueIdThe unique id of the object.
intensityThe intensity (affects visibility).
virtual void makVrv::DtWeatherAreaGroup::setWeatherPrecipitationShaftBaseColor ( DtUniqueID  uniqueId,
const DtVector color 
)
virtual

brief Set the base color for a precipitation shaft object.

Parameters
uniqueIdThe unique id of the object.
colorThe rgb color to use (0.0 - 1.0 scale).
virtual void makVrv::DtWeatherAreaGroup::setWeatherPrecipitationShaftWind ( DtUniqueID  uniqueId,
const float  windDirectionRad,
const float  windSpeedMps 
)
virtual

Sets the current wind for a precipitation shaft object.

Parameters
uniqueIdThe unique id of the object.
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherAreaGroup::setWeatherPrecipitationShaftEnabled ( DtUniqueID  uniqueId,
bool  enabled 
)
virtual

Enables or disables a precipitation shaft object.

Parameters
uniqueIdThe unique id of the object.
enabledSet to true to enable the object.
virtual DtUniqueID makVrv::DtWeatherAreaGroup::addLightning ( osg::Vec3d &  position,
const osg::Matrixd &  rotation,
const DtVector bounds,
const float  cornerRadius,
const float  intensity 
)
virtual

Adds a lightning object. Returns a unique id for the added object.

Parameters
positionThe object transform position.
rotationThe object transform rotation.
boundsThe width, length, height of the bounds.
cornerRadiusThe corner radius of the bounds: must be <= min(width, length)
intensityThe intensity (affects lightning strikes).
virtual void makVrv::DtWeatherAreaGroup::removeLightning ( DtUniqueID  uniqueId)
virtual

Remove a lightning object.

Parameters
uniqueIdThe lightning object id.
virtual void makVrv::DtWeatherAreaGroup::setWeatherLightningBounds ( DtUniqueID  uniqueId,
const DtVector bounds,
const float  cornerRadius 
)
virtual

Sets the bounds for a lightning object.

Parameters
uniqueIdThe lightning object id.
boundsThe width, length, height of the bounds.
cornerRadiusThe corner radius of the bounds: must be <= min(width, length)
virtual void makVrv::DtWeatherAreaGroup::setWeatherLightningTransform ( DtUniqueID  uniqueId,
const osg::Vec3d &  position,
const osg::Matrixd &  rotation 
)
virtual

Sets the position and rotation for a lightning object.

Parameters
uniqueIdThelightning object id.
positionThe object transform position.
rotationThe object transform rotation.
virtual void makVrv::DtWeatherAreaGroup::setWeatherLightningIntensity ( DtUniqueID  uniqueId,
const float  intensity 
)
virtual

brief Set the intensity for a lightning object.

Parameters
uniqueIdThe unique id of the object.
intensityThe intensity (affects lightning strikes).
virtual void makVrv::DtWeatherAreaGroup::setWeatherLightningEnabled ( DtUniqueID  uniqueId,
bool  enabled 
)
virtual

Enables or disables a lightning object.

Parameters
uniqueIdThe unique id of the object.
enabledSet to true to enable the object.
virtual void makVrv::DtWeatherAreaGroup::setCloudLayerDensity ( DtCloudLayerId  layerId,
float  density 
)
virtual

brief Set the fog density for a layer.

Parameters
layerIdThe layer to act upon.
densityThis fog density exp() control.
virtual void makVrv::DtWeatherAreaGroup::setHeightFogDensity ( DtUniqueID  uniqueId,
float  density 
)
virtual

brief Set the density for a height fog object.

Parameters
uniqueIdThe unique id of the object.
densityThis fog density exp() control.
virtual void makVrv::DtWeatherAreaGroup::setCloudLayerEnabled ( DtCloudLayerId  layerId,
bool  enabled 
)
virtual

Enables or disables a layer.

Parameters
layerIdThe layer to act upon.
enabledSet to true to enable the layer.
virtual void makVrv::DtWeatherAreaGroup::setHeightFogEnabled ( DtUniqueID  uniqueId,
bool  enabled 
)
virtual

Enables or disables a height fog object.

Parameters
uniqueIdThe unique id of the object.
enabledSet to true to enable the object.
virtual void makVrv::DtWeatherAreaGroup::setCloudLayerPositionAndOrientation ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation 
)
virtual

Sets the transform for the given layer.

virtual void makVrv::DtWeatherAreaGroup::setHeightFogPositionAndOrientation ( DtUniqueID  uniqueId,
const DtVector position,
float  orientation,
bool  relative 
)
virtual

Sets the position and orientation for a height fog object.

virtual void makVrv::DtWeatherAreaGroup::setCloudLayerBaseColor ( DtCloudLayerId  layerId,
float  red,
float  green,
float  blue 
)
virtual

Sets the base material color for a cloud layer.

Parameters
layerIdThe layer to act upon.
redThe red component color to set in the range of (0.0 - 1.0).
greenThe green component color to set in the range of (0.0 - 1.0).
blueThe blue component color to set in the range of (0.0 - 1.0).
virtual void makVrv::DtWeatherAreaGroup::setHeightFogBaseColor ( DtUniqueID  uniqueId,
float  red,
float  green,
float  blue 
)
virtual

Sets the base material color for a height fog object.

Parameters
uniqueIdThe height fog object id.
redThe red component color to set in the range of (0.0 - 1.0).
greenThe green component color to set in the range of (0.0 - 1.0).
blueThe blue component color to set in the range of (0.0 - 1.0).
virtual void makVrv::DtWeatherAreaGroup::setHeightFogBounds ( DtUniqueID  uniqueId,
const DtVector bounds,
const float  cornerRadius 
)
virtual

Sets the bounds for a height fog object.

Parameters
uniqueIdThe height fog object id.
boundsThe width, length, height if the bounds.
cornerRadiusThe corner radius of the bounds: must be <= min(width, length)
virtual void makVrv::DtWeatherAreaGroup::setCloudLayerParticleSizeVariation ( DtCloudLayerId  layerId,
float  variation 
)
virtual

Sets a size variation for particles used to fill voxel space.

Parameters
layerIdThe layer to act upon.
variationThe random variation (typically 0.0 to 0.5).
virtual void makVrv::DtWeatherAreaGroup::setCloudLayerPatternedLook ( DtCloudLayerId  layerId,
bool  patternedEnable 
)
virtual

Enables or disables a patterned look (typically true for sandstorms).

Parameters
layerIdThe layer to act upon.
patternedEnableIf true, enables a patterned look.
virtual void makVrv::DtWeatherAreaGroup::setCloudLayerWind ( DtCloudLayerId  layerId,
float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the local wind for a cloud layer.

Parameters
layerIdThe layer to act upon.
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherAreaGroup::setGlobalWind ( float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the current global wind to use for fog and weather areas.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtWeatherAreaGroup::drawObjects ( osg::RenderInfo &  renderInfo,
const DtWeatherAreaDrawable drawable 
)
virtual

Draw all objects.

virtual void makVrv::DtWeatherAreaGroup::gatherWeatherAreas ( const osg::Vec3d &  position,
std::vector< DtWeatherArea * > &  areas 
)
virtual

Gets a list of active weather areas that intersect the given position.

Parameters
positionThe position to check.
areasThe list to fill in.
virtual bool makVrv::DtWeatherAreaGroup::computeLocalPrecipitation ( const DtVector location,
int precipType,
float &  intensity 
)
virtual

Computes the precipitation at the given location. Returns true if location is in an active area, otherwise false.

Parameters
locationThe location to compute the precipitation at.
precipTypeThe computed precipitation type (DtSkyObject::PrecipitationType).
intensityThe computed precipitation intensity.
virtual bool makVrv::DtWeatherAreaGroup::computeLocalGroundRainAccumulation ( const DtVector location,
float &  depth,
float &  blend 
)
virtual

Computes the ground rain accumulation at the given location. Returns true if location is in an active 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 bool makVrv::DtWeatherAreaGroup::shouldActivateRaindrops ( ) const
virtual

Check for local precipitation active to see whether to draw the rain post effect.

virtual bool makVrv::DtWeatherAreaGroup::bindFogFroxelTexture ( const int  unit,
const unsigned int  renderContextId 
)
virtual

Binds the fog froxel texture object to the given texture unit for the given render context. Returns true if the froxel texture is enabled.

Parameters
unitThe texture unit to bind to.
renderContextIdThe current render context used for drawing.
virtual float makVrv::DtWeatherAreaGroup::fogFroxelMaxDistance ( ) const
virtual

Returns the maximum distance used for fog froxel calulations.

virtual void makVrv::DtWeatherAreaGroup::initGroundFogPatchState ( )
protectedvirtual

Initializes the draw state for ground fog patch objects.

virtual void makVrv::DtWeatherAreaGroup::initSandstormState ( )
protectedvirtual

Initializes the draw state for sandstorm objects.

virtual void makVrv::DtWeatherAreaGroup::initGroundFogEffectState ( )
protectedvirtual

Initializes the draw state for ground fog effect objects.

virtual void makVrv::DtWeatherAreaGroup::initPrecipitationShaftState ( )
protectedvirtual

Initializes the draw state for precipitation shaft objects.

virtual void makVrv::DtWeatherAreaGroup::initLightningState ( )
protectedvirtual

Initializes the draw state for lightning objects.

virtual void makVrv::DtWeatherAreaGroup::loadShaders ( )
protectedvirtual

Loads all shaders used to draw objects.

virtual void makVrv::DtWeatherAreaGroup::loadGroundFogPatchShaders ( )
protectedvirtual

Loads shaders used to draw ground fog objects.

virtual void makVrv::DtWeatherAreaGroup::loadSandstormShaders ( )
protectedvirtual

Loads shaders used to sandstorm objects.

virtual void makVrv::DtWeatherAreaGroup::loadGroundFogEffectShaders ( )
protectedvirtual

Loads shaders used to draw ground fog effects objects.

virtual void makVrv::DtWeatherAreaGroup::loadPrecipitationShaftShaders ( )
protectedvirtual

Loads shaders used to draw precipitation shaft objects.

virtual void makVrv::DtWeatherAreaGroup::loadLightningShaders ( )
protectedvirtual

Loads shaders used to draw lightning objects.

virtual void makVrv::DtWeatherAreaGroup::clearDrawBins ( )
protectedvirtual

Clear all draw bins.

void makVrv::DtWeatherAreaGroup::flushDrawBin ( osg::RenderInfo &  renderInfo,
const DtWeatherAreaDrawable drawable,
std::vector< DrawItem > &  drawBin 
)
protected

Draws all items in the given draw bin.

virtual void makVrv::DtWeatherAreaGroup::drawGroundFogPatchArea ( DtGroundFogPatchArea::DrawData drawData,
DtGroundFogPatchArea area,
const bool  stateDirty 
)
protectedvirtual

Draw a ground fog patch area (or a sandstorm area).

virtual void makVrv::DtWeatherAreaGroup::drawGroundFogEffect ( DtGroundFogEffect::DrawData drawData,
DtGroundFogPatchArea area,
const bool  stateDirty 
)
protectedvirtual

Draw ground fog effects in a ground fog patch area.

virtual void makVrv::DtWeatherAreaGroup::drawPrecipitationShaft ( DtWeatherPrecipitationShaft::DrawData drawData,
DtWeatherPrecipitationShaft shaft,
const bool  stateDirty 
)
protectedvirtual

Draw a precipitation shaft.

virtual void makVrv::DtWeatherAreaGroup::drawLightning ( DtWeatherLightning::DrawData drawData,
DtWeatherLightning lightning,
const bool  stateDirty 
)
protectedvirtual

Draw lightning.

virtual void makVrv::DtWeatherAreaGroup::applyState ( DtGroundFogPatchArea::DrawData drawData,
GroundFogPatchState mutableState 
) const
protectedvirtual

Called to apply the ground fog patch (or sandstorm) state for drawing.

Parameters
drawDataThe data used to draw a ground fog patch.
mutableStateThe state based on the material (ground fog or sandstorm).
virtual void makVrv::DtWeatherAreaGroup::applyState ( DtGroundFogEffect::DrawData drawData) const
protectedvirtual

Called to apply the ground fog effect state for drawing.

virtual void makVrv::DtWeatherAreaGroup::applyState ( DtWeatherPrecipitationShaft::DrawData drawData) const
protectedvirtual

Called to apply the precipitation shaft state for drawing.

virtual void makVrv::DtWeatherAreaGroup::applyState ( DtWeatherLightning::DrawData drawData) const
protectedvirtual

Called to apply the lightning state for drawing.

virtual void makVrv::DtWeatherAreaGroup::initSoftnessUniforms ( osg::StateSet &  ss,
SoftnessUniforms softnessUniforms 
)
protectedvirtual

Initializes the uniforms associated with depth soften.

virtual void makVrv::DtWeatherAreaGroup::setupSoftness ( osg::Camera *  camera,
SoftnessUniforms softnessUniforms 
) const
protectedvirtual

Setup softness parameters used when drawing.

Parameters
cameraThe current camera being drawn.
softnessUniformsThe uniforms associated with softness to be set.
void makVrv::DtWeatherAreaGroup::connectSignals ( )
protected

Connects all the signals, Non-virtural, called in the ctor.

virtual void makVrv::DtWeatherAreaGroup::slot_reloadShaders ( )
protectedvirtual

Signal handler to reload the shaders.

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

Signal handler to run a simulation update.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectAdded ( DtUniqueID  id,
DtWeatherAreaObject  
)
protectedvirtual

Slot to handle signal for when a weather area is added.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectToBeRemoved ( DtUniqueID  id,
DtWeatherAreaObject  
)
protectedvirtual

Slot to handle signal for when a weather area is about to be removed.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectTransformChanged ( DtUniqueID  id,
const DtVector position,
const float  orientation 
)
protectedvirtual

Slot to handle signal for when a weather area transform changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectBoundsChanged ( DtUniqueID  id,
const DtVector bounds,
const float  cornerRadius 
)
protectedvirtual

Slot to handle signal for when a weather area bounds changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectPrecipitationIntensityChanged ( DtUniqueID  id,
const float  intensity 
)
protectedvirtual

Slot to handle signal for when a weather area precipitation intensity changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectPrecipitationTypeChanged ( DtUniqueID  id,
const unsigned int  type 
)
protectedvirtual

Slot to handle signal for when a weather area precipitation type changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectGroundRainAccumulationChanged ( DtUniqueID  id,
const float  depth 
)
protectedvirtual

Slot to handle signal for when a weather area ground rain accumulation changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectFogColorChanged ( DtUniqueID  id,
const DtVector color 
)
protectedvirtual

Slot to handle signal for when a weather area fog color changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectVisibilityDistanceChanged ( DtUniqueID  id,
const float  distance 
)
protectedvirtual

Slot to handle signal for when a weather area visibility distance changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectOvercastChanged ( DtUniqueID  id,
const float  distance 
)
protectedvirtual

Slot to handle signal for when a weather area overcast changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectLightningEnabledChanged ( DtUniqueID  id,
const bool  enabled 
)
protectedvirtual

Slot to handle signal for when a weather area lightning enable changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectWindChanged ( DtUniqueID  id,
const float  direction,
const float  speed 
)
protectedvirtual

Slot to handle signal for when a weather area wind changes.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectCloudLayerAdded ( DtUniqueID  id,
DtCloudLayerId  layerId,
int  cloudType 
)
protectedvirtual

Slot to handle signal for when a weather area adds a cloud layer.

virtual void makVrv::DtWeatherAreaGroup::slot_weatherAreaObjectCloudLayerRemoved ( DtUniqueID  id,
DtCloudLayerId  layerId 
)
protectedvirtual

Slot to handle signal for when a weather area removes a cloud layer.

virtual void makVrv::DtWeatherAreaGroup::traverse ( osg::NodeVisitor &  nv)
protectedvirtual

Traverse.

virtual void makVrv::DtWeatherAreaGroup::disableHeightFog ( )
protectedvirtual

Disables height fog shader calculations.

virtual void makVrv::DtWeatherAreaGroup::cullUpdate ( osg::Camera *  cam)
protectedvirtual

Update draw objects for current camera.

Parameters
camThe current camera.
virtual void makVrv::DtWeatherAreaGroup::cullUpdateHeightFog ( osg::Camera *  cam)
protectedvirtual

Updates the height layers for current camera.

Parameters
camThe current camera.
virtual void makVrv::DtWeatherAreaGroup::computeBasis ( const osg::Vec3d &  inGeocentricPos,
osg::Matrixd &  rotOut 
)
protectedvirtual

Computes a basis rotation matrix for the given geocentric position.

Parameters
inGeocentricPosThe geocentric reference position.
rotOutThe computed basis rotation transform.
virtual void makVrv::DtWeatherAreaGroup::releaseGroundFogPatchGLObjects ( osg::State *  state) const
protectedvirtual

Release all gl objects used by groundfog patch (and sandstorm) objects.

virtual void makVrv::DtWeatherAreaGroup::releaseGroundFogEffectGLObjects ( osg::State *  state) const
protectedvirtual

Release all gl objects used by groundfog effect objects.

virtual void makVrv::DtWeatherAreaGroup::releaseWeatherPrecipitationShaftGLObjects ( osg::State *  state) const
protectedvirtual

Release all gl objects used by weather precipitation shaft objects.

virtual void makVrv::DtWeatherAreaGroup::releaseWeatherLightningGLObjects ( osg::State *  state) const
protectedvirtual

Release all gl objects used by weather lightning objects.

osg::Node* makVrv::DtWeatherAreaGroup::getChildNodeByName ( osg::Group *  parent,
const char name 
)
private

This is private and non-virtual because it's used in the constructor. This method returns the first child node that matches the given name.

Member Data Documentation

DtDe& makVrv::DtWeatherAreaGroup::myDe
protected
float makVrv::DtWeatherAreaGroup::myWindSpeedMps
protected
float makVrv::DtWeatherAreaGroup::myWindDirectionRad
protected
osg::ref_ptr<osg::Node> makVrv::DtWeatherAreaGroup::mySensorNodes[SensorMaterialTypeCount]
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::mySortPreCloudsGroupNode
protected
osg::ref_ptr<osg::Geode> makVrv::DtWeatherAreaGroup::mySortPreCloudsGeode
protected
osg::ref_ptr<makVrv::DtWeatherAreaDrawable> makVrv::DtWeatherAreaGroup::mySortPreCloudsDrawable
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::mySortPostCloudsGroupNode
protected
osg::ref_ptr<osg::Geode> makVrv::DtWeatherAreaGroup::mySortPostCloudsGeode
protected
osg::ref_ptr<makVrv::DtWeatherAreaDrawable> makVrv::DtWeatherAreaGroup::mySortPostCloudsDrawable
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::mySortTransparentGroupNode
protected
osg::ref_ptr<osg::Geode> makVrv::DtWeatherAreaGroup::mySortTransparentGeode
protected
osg::ref_ptr<makVrv::DtWeatherAreaDrawable> makVrv::DtWeatherAreaGroup::mySortTransparentDrawable
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::myGroundFogPatchSensorGroup
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::mySandstormSensorGroup
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::myGroundFogEffectSensorGroup
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::myWeatherPrecipitationShaftSensorGroup
protected
osg::ref_ptr<osg::Group> makVrv::DtWeatherAreaGroup::myWeatherLightningSensorGroup
protected
std::vector<DrawItem> makVrv::DtWeatherAreaGroup::myPreSortBin
protected
std::vector<DrawItem> makVrv::DtWeatherAreaGroup::mySortBinPreClouds
protected
std::vector<DrawItem> makVrv::DtWeatherAreaGroup::mySortBinPostClouds
protected
std::vector<DrawItem> makVrv::DtWeatherAreaGroup::mySortBinTransparent
protected
GroundFogPatchState makVrv::DtWeatherAreaGroup::myMutableGroundFogPatchState
mutableprotected
GroundFogPatchState makVrv::DtWeatherAreaGroup::myMutableSandstormState
mutableprotected
GroundFogEffectState makVrv::DtWeatherAreaGroup::myMutableGroundFogEffectState
mutableprotected
PrecipitationShaftState makVrv::DtWeatherAreaGroup::myMutablePrecipitationShaftState
mutableprotected
LightningState makVrv::DtWeatherAreaGroup::myMutableLightningState
mutableprotected
DtHeightFogMap makVrv::DtWeatherAreaGroup::myHeightFogMap
protected
DtCloudLayerIdToUniqueIdMap makVrv::DtWeatherAreaGroup::myCloudLayerIdToUniqueIdMap
protected
std::vector<osg::Vec4d> makVrv::DtWeatherAreaGroup::myCullingPlanes
protected
double makVrv::DtWeatherAreaGroup::myLastTime
protected
float makVrv::DtWeatherAreaGroup::myTimeStep
protected
DtJobSplitter* makVrv::DtWeatherAreaGroup::myJobSplitter
protected
DtSignalConnectionManager makVrv::DtWeatherAreaGroup::myConnections
protected
DtWeatherFogFroxelGrid* makVrv::DtWeatherAreaGroup::myWeatherFogFroxelGrid
protected
DtGroundFogPatchAreaMap makVrv::DtWeatherAreaGroup::myMutableGroundFogPatchAreaMap
mutableprivate
DtWeatherAreaMap makVrv::DtWeatherAreaGroup::myMutableWeatherAreaMap
mutableprivate
DtWeatherAreaObjectMap makVrv::DtWeatherAreaGroup::myMutableWeatherAreaObjectMap
mutableprivate
DtWeatherPrecipitationShaftMap makVrv::DtWeatherAreaGroup::myMutableWeatherPrecipitationShaftMap
mutableprivate
DtWeatherLightningMap makVrv::DtWeatherAreaGroup::myMutableWeatherLightningMap
mutableprivate

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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)