VR-Forces 4.8 Class Documentation
 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::DtGroundFogGroup Class Reference

A group node which serves as a root for patchy ground fog areas, and effects in addition to infinite height fog and sandstorms. More...

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

Classes

struct  HeightFogItem
 A structure to hold data for a height fog object. More...
 

Public Types

enum  SENSOR_MATERIAL {
  SENSOR_MATERIAL_NONE = 0, SENSOR_MATERIAL_PATCHY_GROUND_FOG, SENSOR_MATERIAL_SANDSTORM, SENSOR_MATERIAL_SANDSTORM_EFFECT,
  SENSOR_MATERIAL_COUNT
}
 brief Sensor material type enumerations used for sensorfx. More...
 

Public Member Functions

 DtGroundFogGroup (DtDe &de)
 CTOR. More...
 
 DtGroundFogGroup (const DtGroundFogGroup &orig, const osg::CopyOp &opr)
 Copy constructor needed because it is derived from osg::Group. More...
 
virtual ~DtGroundFogGroup ()
 DTOR. More...
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 required functions for derriving from osg::Group More...
 
virtual osg::Object * cloneType () const
 
virtual void releaseGroundFogPatchGLObjects (osg::State *state) const
 Release all gl objects used by groundfog patch objects. More...
 
virtual void releaseGroundFogEffectGLObjects (osg::State *state) const
 Release all gl objects used by groundfog effect objects. More...
 
virtual void deleteGeode ()
 Tell the group to delete its specific children. More...
 
virtual osg::Node * getOrCreateSensorNode (SENSOR_MATERIAL matType)
 
virtual void removeCloudLayer (DtCloudLayerId layerId)
 Remove a cloud layer. More...
 
virtual void removeCloudLayers ()
 Remove all the cloud decks. More...
 
virtual void addGroundFog (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool infinite, bool relative, bool altitudeIsHAT)
 Adds a ground fog layer. More...
 
virtual void addPatchyGroundFog (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool relative)
 Adds a patchy ground fog layer. More...
 
virtual void addSandstorm (DtCloudLayerId layerId, const DtVector &position, float orientation, float cornerRadius, const DtVector &bounds, double density, bool infinite, bool relative, bool altitudeIsHAT)
 Adds a sandstorm layer. More...
 
virtual void setCloudLayerDensity (DtCloudLayerId layerId, float density)
 brief Set the fog density for a layer. More...
 
virtual void setCloudLayerEnabled (DtCloudLayerId layerId, bool enabled)
 Enables or disables a layer. More...
 
virtual void setCloudLayerPositionAndOrientation (DtCloudLayerId layerId, const DtVector &position, float orientation)
 Sets the transform for the given layer. More...
 
virtual void setCloudLayerBaseColor (DtCloudLayerId layerId, float red, float green, float blue)
 Sets the base material color for a cloud layer. More...
 
virtual void setCloudLayerParticleSizeVariation (DtCloudLayerId layerId, float variation)
 Sets a size variation for particles used to fill voxel space. More...
 
virtual void setCloudLayerPatternedLook (DtCloudLayerId layerId, bool patternedEnable)
 Enables or disables a patterned look (typically true for sandstorms). More...
 
virtual void setWind (float windDirectionRad, float windSpeedMps)
 Sets the current wind to use for fog. More...
 
virtual void drawGroundFogPatchAreas (DtGroundFogPatchArea::DrawData &drawData)
 Draw all ground fog patch areas. More...
 
virtual void drawGroundFogEffects (DtGroundFogEffect::DrawData &drawData)
 Draw all ground fog effects. More...
 

Protected Types

typedef std::map< int,
HeightFogItem
DtHeightFogMap
 

Protected Member Functions

virtual void traverse (osg::NodeVisitor &nv)
 Traverse. More...
 
virtual void disableHeightFog ()
 Disables height fog shader calculations. More...
 
virtual void cullUpdate (osg::Camera *cam)
 Update draw objects for current camera. More...
 
virtual void cullUpdateHeightFog (osg::Camera *cam)
 Updates the height layers for current camera. More...
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut)
 Computes a basis rotation matrix for the given geocentric position. More...
 
void setHeightFogTransform (HeightFogItem *item, const DtVector &position, bool relativeToCamera)
 Sets a height fog transform. More...
 

Protected Attributes

DtDemyDe
 
osg::ref_ptr< osg::Node > mySensorNodes [SENSOR_MATERIAL_COUNT]
 
osg::ref_ptr< osg::Group > myGroundFogSensorGroup
 
osg::ref_ptr< osg::Geode > myGroundFogGeode
 
osg::ref_ptr
< makVrv::DtGroundFogPatchDrawable
myGroundFogPatchDrawable
 
osg::ref_ptr< osg::Group > myEffectSensorGroup
 
osg::ref_ptr< osg::Geode > myEffectGeode
 
osg::ref_ptr
< makVrv::DtGroundFogEffectDrawable
myEffectDrawable
 
DtHeightFogMap myHeightFogMap
 
std::vector< osg::Vec4d > myCullingPlanes
 
DtJobSplittermyJobSplitter
 

Private Types

typedef std::map
< DtCloudLayerId,
DtGroundFogPatchArea * > 
DtGroundFogPatchAreaMap
 This is mutable because it's used as part of the const drawImplementation. More...
 

Private Member Functions

 DtGroundFogGroup (const DtGroundFogGroup &other)
 Copy Constructor not implemented - Copy not allowed. More...
 
DtGroundFogGroupoperator= (const DtGroundFogGroup &other)
 Assignment Operator not implemented - Assignment not allowed. More...
 
osg::Node * getChildNodeByName (osg::Group *parent, const char *name)
 This is private and non-virtual because it's used in the constructor. More...
 

Private Attributes

DtGroundFogPatchAreaMap myMutableGroundFogPatchAreaMap
 

Detailed Description

A group node which serves as a root for patchy ground fog areas, and effects in addition to infinite height fog and sandstorms.

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. There are 2 geodes under this node for ground fog areas and ground fog effects. 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.

Member Typedef Documentation

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
SENSOR_MATERIAL_NONE 
SENSOR_MATERIAL_PATCHY_GROUND_FOG 
SENSOR_MATERIAL_SANDSTORM 
SENSOR_MATERIAL_SANDSTORM_EFFECT 
SENSOR_MATERIAL_COUNT 

Constructor & Destructor Documentation

makVrv::DtGroundFogGroup::DtGroundFogGroup ( DtDe de)

CTOR.

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

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

virtual makVrv::DtGroundFogGroup::~DtGroundFogGroup ( )
virtual

DTOR.

makVrv::DtGroundFogGroup::DtGroundFogGroup ( const DtGroundFogGroup other)
private

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtGroundFogGroup& makVrv::DtGroundFogGroup::operator= ( const DtGroundFogGroup other)
private

Assignment Operator not implemented - Assignment not allowed.

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

required functions for derriving from osg::Group

virtual osg::Object* makVrv::DtGroundFogGroup::cloneType ( ) const
inlinevirtual
virtual void makVrv::DtGroundFogGroup::releaseGroundFogPatchGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by groundfog patch objects.

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

Release all gl objects used by groundfog effect objects.

virtual void makVrv::DtGroundFogGroup::deleteGeode ( )
virtual

Tell the group to delete its specific children.

virtual osg::Node* makVrv::DtGroundFogGroup::getOrCreateSensorNode ( SENSOR_MATERIAL  matType)
virtual
virtual void makVrv::DtGroundFogGroup::removeCloudLayer ( DtCloudLayerId  layerId)
virtual

Remove a cloud layer.

virtual void makVrv::DtGroundFogGroup::removeCloudLayers ( )
virtual

Remove all the cloud decks.

virtual void makVrv::DtGroundFogGroup::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 void makVrv::DtGroundFogGroup::addPatchyGroundFog ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation,
float  cornerRadius,
const DtVector bounds,
double  density,
bool  relative 
)
virtual

Adds a patchy ground fog layer.

virtual void makVrv::DtGroundFogGroup::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::DtGroundFogGroup::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::DtGroundFogGroup::setCloudLayerEnabled ( DtCloudLayerId  layerId,
bool  enabled 
)
virtual

Enables or disables a layer.

Parameters
layerIdThe layer to act upon.
enabledSet to true to enable to layer.
virtual void makVrv::DtGroundFogGroup::setCloudLayerPositionAndOrientation ( DtCloudLayerId  layerId,
const DtVector position,
float  orientation 
)
virtual

Sets the transform for the given layer.

virtual void makVrv::DtGroundFogGroup::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::DtGroundFogGroup::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::DtGroundFogGroup::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::DtGroundFogGroup::setWind ( float  windDirectionRad,
float  windSpeedMps 
)
virtual

Sets the current wind to use for fog.

Parameters
windDirectionRadThe wind direction in radians.
windSpeedMpsThe wind speed in meters per second.
virtual void makVrv::DtGroundFogGroup::drawGroundFogPatchAreas ( DtGroundFogPatchArea::DrawData drawData)
virtual

Draw all ground fog patch areas.

virtual void makVrv::DtGroundFogGroup::drawGroundFogEffects ( DtGroundFogEffect::DrawData drawData)
virtual

Draw all ground fog effects.

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

Traverse.

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

Disables height fog shader calculations.

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

Update draw objects for current camera.

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

Updates the height layers for current camera.

Parameters
camThe current camera.
virtual void makVrv::DtGroundFogGroup::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.
void makVrv::DtGroundFogGroup::setHeightFogTransform ( HeightFogItem item,
const DtVector position,
bool  relativeToCamera 
)
protected

Sets a height fog transform.

Parameters
positionThe transform position in world space.
relativeToCameraSet to true if the position is relative to the current camera.
osg::Node* makVrv::DtGroundFogGroup::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::DtGroundFogGroup::myDe
protected
osg::ref_ptr<osg::Node> makVrv::DtGroundFogGroup::mySensorNodes[SENSOR_MATERIAL_COUNT]
protected
osg::ref_ptr<osg::Group> makVrv::DtGroundFogGroup::myGroundFogSensorGroup
protected
osg::ref_ptr<osg::Geode> makVrv::DtGroundFogGroup::myGroundFogGeode
protected
osg::ref_ptr<makVrv::DtGroundFogPatchDrawable> makVrv::DtGroundFogGroup::myGroundFogPatchDrawable
protected
osg::ref_ptr<osg::Group> makVrv::DtGroundFogGroup::myEffectSensorGroup
protected
osg::ref_ptr<osg::Geode> makVrv::DtGroundFogGroup::myEffectGeode
protected
osg::ref_ptr<makVrv::DtGroundFogEffectDrawable> makVrv::DtGroundFogGroup::myEffectDrawable
protected
DtHeightFogMap makVrv::DtGroundFogGroup::myHeightFogMap
protected
std::vector<osg::Vec4d> makVrv::DtGroundFogGroup::myCullingPlanes
protected
DtJobSplitter* makVrv::DtGroundFogGroup::myJobSplitter
protected
DtGroundFogPatchAreaMap makVrv::DtGroundFogGroup::myMutableGroundFogPatchAreaMap
mutableprivate

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)