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 Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
makVrv::DtGroundFogPatchArea Class Reference

An area of ground fog patch items and effects. More...

Classes

struct  BoneWeight
 A structure used to define a skeleton bone weight. More...
 
struct  DrawData
 A structure used to hold data for drawing. More...
 
struct  MeshGroup
 A structure used to define a mesh group (voa, positions, coords). More...
 

Public Types

enum  AREA_TYPE { AREA_TYPE_PATCHY_GROUND_FOG, AREA_TYPE_SANDSTORM }
 brief Area type enumerations. More...
 

Public Member Functions

 DtGroundFogPatchArea (makVrv::DtDe &de)
 CTOR. More...
 
virtual ~DtGroundFogPatchArea ()
 DTOR. More...
 
virtual void init (float worldSize, float thickness)
 Initializes the area. More...
 
virtual void addEffect (DtGroundFogEffect *effect)
 brief Adds an effect to this area. More...
 
virtual void releaseFogPatchGLObjects (osg::State *state) const
 Release all gl objects used by fog patches in this area. More...
 
virtual void releaseFogEffectGLObjects (osg::State *state) const
 Release all gl objects used by fog effects in this area. More...
 
virtual void cullUpdate (const osg::Vec3d &camPos, const osg::Matrixd &viewMatrixI, const std::vector< osg::Vec4d > &cullingPlanes, DtJobSplitter *jobSplitter)
 Updates ground fog area based on the current camera. More...
 
virtual bool shouldDrawFogPatches ()
 Returns true if drawing of fog patches is allowed this draw. More...
 
virtual void drawFogPatches (DtGroundFogPatchArea::DrawData &drawData)
 Do the drawing of fog patches. More...
 
virtual void drawFogEffects (DtGroundFogEffect::DrawData &drawData)
 Do the drawing of fog effects. More...
 
virtual void setDensity (float density)
 brief Set the fog density. More...
 
virtual float density () const
 brief Returns the fog density. More...
 
virtual void setTransform (const DtVector &position, float orientation, bool relativeToCamera=false)
 Sets the fog area transform. More...
 
virtual void setEnabled (bool enabled)
 Enables or disables the fog patch area. More...
 
virtual bool enabled () const
 Returns the enabled state. More...
 
virtual void setClampingEnabled (bool enabled)
 Enables or disables fog clamping to terrain. More...
 
virtual bool clampingEnabled () const
 Returns the clamping enabled state. More...
 
virtual float worldSize () const
 Returns the world size of 1 side of the square area. More...
 
virtual void setBounds (const DtVector &bounds, float cornerRadius)
 Sets the bounds of the area. More...
 
virtual bool isPositionAboveArea (const osg::Vec3d &position)
 Returns true if the given position is above the area peak. More...
 
virtual void setBaseColor (float red, float green, float blue)
 Sets the base material color for the area. More...
 
virtual void setParticleSizeVariation (float variation)
 Sets a size variation for particles used to fill voxel space. More...
 
virtual void setPatternedLook (bool patternedEnable)
 Enables or disables a patterned look (typically "true" for sandstorms). More...
 
virtual void setAreaType (DtGroundFogPatchArea::AREA_TYPE areaType)
 Sets a type for this area. More...
 
virtual
DtGroundFogPatchArea::AREA_TYPE 
areaType () const
 Gets a area type for this area. More...
 

Protected Member Functions

virtual void freeData (void)
 Frees resources associated with patches. More...
 
virtual void computeWeights (float x, float y, float patchSize, float *bones, float *weights)
 Computes a skeletal weights for a local cell position. More...
 
virtual void initLod (int gridSize, float patchSize)
 Initializes an lod for a patch. More...
 
virtual bool bindMeshGroupData (MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 Binds the mesh group data to the vbo's. More...
 
virtual bool bindVaoToMeshGroup (GLuint vao, MeshGroup *meshGroup, osg::RenderInfo &renderInfo) const
 Binds the given voa to vbo's for a mesh group. More...
 
virtual void computeBasis (const osg::Vec3d &inGeocentricPos, osg::Matrixd &rotOut)
 Ccomputes a basis rotation matrix for the given geocentric position. More...
 
virtual void computeSortDepth (const osg::Vec3 &camPos)
 Computes the sort depth for all patches. More...
 
virtual void inverseTransformPlane (osg::Vec4d &plane, const osg::Vec3d &position, const osg::Matrixd &rotation)
 Transforms a plane into a local transform space. More...
 
virtual bool isSphereVisible (const std::vector< osg::Vec4d > &planes, const osg::Vec3d &center, double radius)
 Tests to see if a sphere is visible using the given frustum planes. More...
 
virtual void computeBoundsCulling ()
 For each patch, computes if it is culled from the bounds and stores results. More...
 
virtual float computeEffectFade (const osg::Vec3 &localCam)
 Computes and returns a (0.0 - 1.0) base on camera position inside the bounds. More...
 
virtual double clampDistance () const
 Returns the distance used for bone clamping to the terrain. More...
 
virtual bool clampPosition (osg::Vec3d &position)
 Clamps a position to the terrain. More...
 
virtual float computeParticleSize ()
 Computes the particle size used for voxel filling. More...
 
virtual float computePatchCellSize ()
 Computes the cell size used in a fog patch. More...
 

Static Protected Member Functions

static int theSortWeights (const void *arg0, const void *arg1)
 Sort function used for sorting skeletal weights. More...
 
static int theSortBackToFront (const void *arg0, const void *arg1)
 Sort function used for qsorting patches. More...
 

Protected Attributes

DtDemyDe
 
float myDensity
 
bool myEnabled
 
float myWindU
 
float myWindV
 
double myLastWindTime
 
bool myCameraBasisDirty
 
bool myInitialized
 
bool myClampingEnabled
 
int myClampIndex
 
int myClampBoneIndex
 
float myMaxClampOffset
 
float myBaseColorR
 
float myBaseColorG
 
float myBaseColorB
 
float myParticleSizeVariation
 
float myPatternedLook
 
AREA_TYPE myAreaType
 
MeshGroupmyMeshGroup
 
DtGlVaoManagermyVaoManager
 
osg::Vec3d myPosition
 
float myOrientation
 
osg::Vec3d myBasisPos
 
osg::Matrixd myBasisRot
 
float myBoundsX
 
float myBoundsY
 
float myBoundsCornerRadius
 
int myGridSize
 
float myPatchWorldSize
 
std::vector< DtGroundFogPatch * > myPatches
 
int myPatchCount
 
DtGroundFogPatch ** myRenderPatches
 
int myRenderPatchCount
 
std::vector< DtGroundFogEffect * > myEffects
 

Static Protected Attributes

static const double DT_GFP_CLAMP_DISTANCE
 
static const int DT_GFP_CELL_SIZE
 

Private Member Functions

 DtGroundFogPatchArea ()
 Default Constructor not implemented. More...
 
 DtGroundFogPatchArea (const DtGroundFogPatchArea &other)
 Copy Constructor not implemented - Copy not allowed. More...
 
DtGroundFogPatchAreaoperator= (const DtGroundFogPatchArea &other)
 Assignment Operator not implemented - Assignment not allowed. More...
 

Detailed Description

An area of ground fog patch items and effects.

One ground fog patch area is associated with a non-infinite ground fog cloud layer in the user interface. The area is made up of a rectangular 2d grid of ground fog patch items.

Optionally, ground fog particle effects are added to the area and activated as the camera moves through the area. This area object can be thought of as a manager for fog patches and effects that are within a specified bounds.

Note that sandstorms are also created using a ground fog patch area. The main differences between ground fog and sandstorms are the way the areas are configured such as base color and effects.

Member Enumeration Documentation

brief Area type enumerations.

Area types help with descibing the area for items like sensors.

Enumerator
AREA_TYPE_PATCHY_GROUND_FOG 
AREA_TYPE_SANDSTORM 

Constructor & Destructor Documentation

makVrv::DtGroundFogPatchArea::DtGroundFogPatchArea ( makVrv::DtDe de)

CTOR.

virtual makVrv::DtGroundFogPatchArea::~DtGroundFogPatchArea ( )
virtual

DTOR.

makVrv::DtGroundFogPatchArea::DtGroundFogPatchArea ( )
private

Default Constructor not implemented.

makVrv::DtGroundFogPatchArea::DtGroundFogPatchArea ( const DtGroundFogPatchArea other)
private

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtGroundFogPatchArea::init ( float  worldSize,
float  thickness 
)
virtual

Initializes the area.

Parameters
worldSizeThe world size of 1 horizontal square side (meters).
thicknessThe vertical height of the area (meters).
virtual void makVrv::DtGroundFogPatchArea::addEffect ( DtGroundFogEffect effect)
virtual

brief Adds an effect to this area.

Parameters
effectThis effect object to add.
virtual void makVrv::DtGroundFogPatchArea::releaseFogPatchGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by fog patches in this area.

virtual void makVrv::DtGroundFogPatchArea::releaseFogEffectGLObjects ( osg::State *  state) const
virtual

Release all gl objects used by fog effects in this area.

virtual void makVrv::DtGroundFogPatchArea::cullUpdate ( const osg::Vec3d &  camPos,
const osg::Matrixd &  viewMatrixI,
const std::vector< osg::Vec4d > &  cullingPlanes,
DtJobSplitter jobSplitter 
)
virtual

Updates ground fog area based on the current camera.

Parameters
camThe current camera being drawn.
jobSplitterA job splitter to add predraw jobs to.
virtual bool makVrv::DtGroundFogPatchArea::shouldDrawFogPatches ( )
virtual

Returns true if drawing of fog patches is allowed this draw.

virtual void makVrv::DtGroundFogPatchArea::drawFogPatches ( DtGroundFogPatchArea::DrawData drawData)
virtual

Do the drawing of fog patches.

virtual void makVrv::DtGroundFogPatchArea::drawFogEffects ( DtGroundFogEffect::DrawData drawData)
virtual

Do the drawing of fog effects.

virtual void makVrv::DtGroundFogPatchArea::setDensity ( float  density)
virtual

brief Set the fog density.

Parameters
densityThis fog density exp() control.
virtual float makVrv::DtGroundFogPatchArea::density ( ) const
virtual

brief Returns the fog density.

virtual void makVrv::DtGroundFogPatchArea::setTransform ( const DtVector position,
float  orientation,
bool  relativeToCamera = false 
)
virtual

Sets the fog area transform.

Parameters
positionThe transform position in world space.
oritantationThe yaw orientation in degrees (0 = north).
relativeToCameraSet to true if the position is relative to the current camera.
virtual void makVrv::DtGroundFogPatchArea::setEnabled ( bool  enabled)
virtual

Enables or disables the fog patch area.

Parameters
enabledSet to true to enable the area.
virtual bool makVrv::DtGroundFogPatchArea::enabled ( ) const
virtual

Returns the enabled state.

virtual void makVrv::DtGroundFogPatchArea::setClampingEnabled ( bool  enabled)
virtual

Enables or disables fog clamping to terrain.

Parameters
enabledSet to true to enable clamping.
virtual bool makVrv::DtGroundFogPatchArea::clampingEnabled ( ) const
virtual

Returns the clamping enabled state.

virtual float makVrv::DtGroundFogPatchArea::worldSize ( ) const
virtual

Returns the world size of 1 side of the square area.

virtual void makVrv::DtGroundFogPatchArea::setBounds ( const DtVector bounds,
float  cornerRadius 
)
virtual

Sets the bounds of the area.

Parameters
boundsThe (x,y,z) of the bounds.
cornerRadiusThe radius at each corner of the bounds.
virtual bool makVrv::DtGroundFogPatchArea::isPositionAboveArea ( const osg::Vec3d &  position)
virtual

Returns true if the given position is above the area peak.

Parameters
positionThe position to test.
virtual void makVrv::DtGroundFogPatchArea::setBaseColor ( float  red,
float  green,
float  blue 
)
virtual

Sets the base material color for the area.

Parameters
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::DtGroundFogPatchArea::setParticleSizeVariation ( float  variation)
virtual

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

Parameters
variationThe random variation (typically 0.0 to 0.5).
virtual void makVrv::DtGroundFogPatchArea::setPatternedLook ( bool  patternedEnable)
virtual

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

Setting this to true or false will determine how shading and patchiness are applied in the ground fog patch shader.

Parameters
patternedEnableIf true, enables a patterned look.
virtual void makVrv::DtGroundFogPatchArea::setAreaType ( DtGroundFogPatchArea::AREA_TYPE  areaType)
virtual

Sets a type for this area.

The type is used for determining things like how the area looks in sensors. areaType The area type enumeration.

virtual DtGroundFogPatchArea::AREA_TYPE makVrv::DtGroundFogPatchArea::areaType ( ) const
virtual

Gets a area type for this area.

The area type is used for determining things like how the area looks in sensors.

virtual void makVrv::DtGroundFogPatchArea::freeData ( void  )
protectedvirtual

Frees resources associated with patches.

virtual void makVrv::DtGroundFogPatchArea::computeWeights ( float  x,
float  y,
float  patchSize,
float *  bones,
float *  weights 
)
protectedvirtual

Computes a skeletal weights for a local cell position.

Parameters
xThe x cell position.
yThe y cell position.
patchSizeThe world size of a patch row.
weightsAn array of 4 floats to be filled with best bone indices.
weightsAn array of 4 floats to be filled with best best weights.
virtual void makVrv::DtGroundFogPatchArea::initLod ( int  gridSize,
float  patchSize 
)
protectedvirtual

Initializes an lod for a patch.

Parameters
gridSizeThe number of cells in 1 row of a patch.
patchSizeThe world size of a patch row.
virtual bool makVrv::DtGroundFogPatchArea::bindMeshGroupData ( MeshGroup meshGroup,
osg::RenderInfo &  renderInfo 
) const
protectedvirtual

Binds the mesh group data to the vbo's.

Parameters
meshGroupThe mesh group object to bind.
renderInfoThe current rendering info.
virtual bool makVrv::DtGroundFogPatchArea::bindVaoToMeshGroup ( GLuint  vao,
MeshGroup meshGroup,
osg::RenderInfo &  renderInfo 
) const
protectedvirtual

Binds the given voa to vbo's for a mesh group.

Parameters
vaoThe GL VAO handle.
meshGroupThe mesh group to bind.
renderInfoThe current rendering info.
virtual void makVrv::DtGroundFogPatchArea::computeBasis ( const osg::Vec3d &  inGeocentricPos,
osg::Matrixd &  rotOut 
)
protectedvirtual

Ccomputes a basis rotation matrix for the given geocentric position.

Parameters
inGeocentricPosThe geocentric reference position.
rotOutThe computed basis rotation transform.
virtual void makVrv::DtGroundFogPatchArea::computeSortDepth ( const osg::Vec3 &  camPos)
protectedvirtual

Computes the sort depth for all patches.

Parameters
camPosThe camera position in local fog system space.
virtual void makVrv::DtGroundFogPatchArea::inverseTransformPlane ( osg::Vec4d &  plane,
const osg::Vec3d &  position,
const osg::Matrixd &  rotation 
)
protectedvirtual

Transforms a plane into a local transform space.

Parameters
planeThe plane to transform.
positionThe transform position.
rotationthe transform rotation.
virtual bool makVrv::DtGroundFogPatchArea::isSphereVisible ( const std::vector< osg::Vec4d > &  planes,
const osg::Vec3d &  center,
double  radius 
)
protectedvirtual

Tests to see if a sphere is visible using the given frustum planes.

Parameters
planesThe frustum planes to test the sphere against.
centerThe sphere center position.
radiusthe sphere radius.
virtual void makVrv::DtGroundFogPatchArea::computeBoundsCulling ( )
protectedvirtual

For each patch, computes if it is culled from the bounds and stores results.

virtual float makVrv::DtGroundFogPatchArea::computeEffectFade ( const osg::Vec3 &  localCam)
protectedvirtual

Computes and returns a (0.0 - 1.0) base on camera position inside the bounds.

virtual double makVrv::DtGroundFogPatchArea::clampDistance ( ) const
protectedvirtual

Returns the distance used for bone clamping to the terrain.

virtual bool makVrv::DtGroundFogPatchArea::clampPosition ( osg::Vec3d &  position)
protectedvirtual

Clamps a position to the terrain.

Returns true on success.

Parameters
positionThe position to clamp.
virtual float makVrv::DtGroundFogPatchArea::computeParticleSize ( )
protectedvirtual

Computes the particle size used for voxel filling.

virtual float makVrv::DtGroundFogPatchArea::computePatchCellSize ( )
protectedvirtual

Computes the cell size used in a fog patch.

static int makVrv::DtGroundFogPatchArea::theSortWeights ( const void *  arg0,
const void *  arg1 
)
staticprotected

Sort function used for sorting skeletal weights.

static int makVrv::DtGroundFogPatchArea::theSortBackToFront ( const void *  arg0,
const void *  arg1 
)
staticprotected

Sort function used for qsorting patches.

Member Data Documentation

DtDe& makVrv::DtGroundFogPatchArea::myDe
protected
float makVrv::DtGroundFogPatchArea::myDensity
protected
bool makVrv::DtGroundFogPatchArea::myEnabled
protected
float makVrv::DtGroundFogPatchArea::myWindU
protected
float makVrv::DtGroundFogPatchArea::myWindV
protected
double makVrv::DtGroundFogPatchArea::myLastWindTime
protected
bool makVrv::DtGroundFogPatchArea::myCameraBasisDirty
protected
bool makVrv::DtGroundFogPatchArea::myInitialized
protected
bool makVrv::DtGroundFogPatchArea::myClampingEnabled
protected
int makVrv::DtGroundFogPatchArea::myClampIndex
protected
int makVrv::DtGroundFogPatchArea::myClampBoneIndex
protected
float makVrv::DtGroundFogPatchArea::myMaxClampOffset
protected
float makVrv::DtGroundFogPatchArea::myBaseColorR
protected
float makVrv::DtGroundFogPatchArea::myBaseColorG
protected
float makVrv::DtGroundFogPatchArea::myBaseColorB
protected
float makVrv::DtGroundFogPatchArea::myParticleSizeVariation
protected
float makVrv::DtGroundFogPatchArea::myPatternedLook
protected
AREA_TYPE makVrv::DtGroundFogPatchArea::myAreaType
protected
MeshGroup* makVrv::DtGroundFogPatchArea::myMeshGroup
protected
DtGlVaoManager* makVrv::DtGroundFogPatchArea::myVaoManager
protected
osg::Vec3d makVrv::DtGroundFogPatchArea::myPosition
protected
float makVrv::DtGroundFogPatchArea::myOrientation
protected
osg::Vec3d makVrv::DtGroundFogPatchArea::myBasisPos
protected
osg::Matrixd makVrv::DtGroundFogPatchArea::myBasisRot
protected
float makVrv::DtGroundFogPatchArea::myBoundsX
protected
float makVrv::DtGroundFogPatchArea::myBoundsY
protected
float makVrv::DtGroundFogPatchArea::myBoundsCornerRadius
protected
const double makVrv::DtGroundFogPatchArea::DT_GFP_CLAMP_DISTANCE
staticprotected
const int makVrv::DtGroundFogPatchArea::DT_GFP_CELL_SIZE
staticprotected
int makVrv::DtGroundFogPatchArea::myGridSize
protected
float makVrv::DtGroundFogPatchArea::myPatchWorldSize
protected
std::vector<DtGroundFogPatch*> makVrv::DtGroundFogPatchArea::myPatches
protected
int makVrv::DtGroundFogPatchArea::myPatchCount
protected
DtGroundFogPatch** makVrv::DtGroundFogPatchArea::myRenderPatches
protected
int makVrv::DtGroundFogPatchArea::myRenderPatchCount
protected
std::vector<DtGroundFogEffect*> makVrv::DtGroundFogPatchArea::myEffects
protected

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)