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

an object used to represent 1 patch of a patchy ground fog system. More...

Classes

struct  Cell
 a cell in the voxel grid More...
 
struct  SortJobData
 a structure to hold data for a sorting job More...
 

Public Member Functions

 DtGroundFogPatch ()
 CTOR. More...
 
virtual ~DtGroundFogPatch ()
 DTOR. More...
 
virtual void init (int gridSize, float patchSize)
 Initialize the patch. More...
 
virtual void draw (osg::RenderInfo &renderInfo) const
 Issues the drawing command for the patch. More...
 
virtual void updateAlphaFade (double time)
 Updates alpha fade based on time. More...
 
virtual void cullUpdate (const osg::Vec3d &camPos, DtJobSplitter *jobSplitter)
 Prepares the patch for drawing bsed on the camera position. More...
 
virtual void setTransform (const osg::Vec3d &position)
 Sets the transform for the patch. More...
 
virtual const osg::Vec3d & position () const
 Returns the position of the patch transform. More...
 
virtual const float * skeleton () const
 Returns the skeletal grid used to bend the patch mesh. More...
 
virtual void getBonePosition (int boneIndex, float patchSize, osg::Vec3d &position)
 Gets a skeletal grid bone position. More...
 
virtual void setBoneHeight (int boneIndex, float height)
 Sets a skeletal grid bone height. More...
 
virtual void setDesiredAlphaFade (float value)
 Sets the desired alpha fade to blend to over time. More...
 
virtual void setAlphaFade (float value)
 Sets the alpha fade parameter used for lod. More...
 
virtual float alphaFade () const
 Returns the alpha fade parameter used for lod. More...
 
virtual void SetCulled (bool culled)
 Sets the culled state for this patch. More...
 
virtual bool culled () const
 Returns the culled state for this patch. More...
 
virtual void setBoneHeightExtents (float min, float max)
 Sets the computed minimum maximum bone offsets. More...
 
virtual void getBoneHeightExtents (float &min, float &max)
 Gets the computed minimum maximum bone offsets. More...
 
virtual void computeBoneHeightExtents ()
 Computes the minimum maximum bone offsets. More...
 
virtual void runSort (const osg::Vec3 &localCamPos)
 Sorts cells for the current view. More...
 

Public Attributes

int mySortDepth
 

Protected Member Functions

virtual void computeSortDepth (const osg::Vec3 &camPos)
 Computes the sort depth for all cells. More...
 
virtual void fillSortedIndices ()
 Fills the indice buffer with sorted indices. More...
 

Protected Attributes

unsigned short myIndiceCount
 
unsigned short * myIndices
 
CellmyCells
 
int myCellCount
 
osg::Vec3d myPosition
 
double myLastTime
 
float myAlphaFade
 
float myAlphaFadeDesired
 
bool myCulled
 
float myBoneHeightMin
 
float myBoneHeightMax
 
float mySkeleton [9]
 
SortJobData mySortJobData
 
DtJobSplitterJob mySortJob
 

Private Member Functions

 DtGroundFogPatch (const DtGroundFogPatch &other)
 Copy Constructor not implemented - Copy not allowed. More...
 
DtGroundFogPatchoperator= (const DtGroundFogPatch &other)
 Assignment Operator not implemented - Assignment not allowed. More...
 
void freeData (void)
 frees resources (used in destructor) More...
 

Static Private Member Functions

static int theSortBackToFront (const void *arg0, const void *arg1)
 sort function used for qsorting cells More...
 
static void theSortJob (void *data)
 sort job function used as a callback for job splitting More...
 

Detailed Description

an object used to represent 1 patch of a patchy ground fog system.

The patch is made up of cells in a 2d grid. The grid can optionally use a skelatal structure to clamp and bend in order to follow the ground. Each grid cell represents a volume division and is rendered using a particle. Note that sandstorms also make use of color patchy ground fog.

Constructor & Destructor Documentation

makVrv::DtGroundFogPatch::DtGroundFogPatch ( )

CTOR.

virtual makVrv::DtGroundFogPatch::~DtGroundFogPatch ( )
virtual

DTOR.

makVrv::DtGroundFogPatch::DtGroundFogPatch ( const DtGroundFogPatch other)
private

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

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

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtGroundFogPatch::init ( int  gridSize,
float  patchSize 
)
virtual

Initialize the patch.

Parameters
gridSizeThe number of cells in 1 row of the patch.
patchSizeThe world space size of 1 row of the patch.
virtual void makVrv::DtGroundFogPatch::draw ( osg::RenderInfo &  renderInfo) const
virtual

Issues the drawing command for the patch.

virtual void makVrv::DtGroundFogPatch::updateAlphaFade ( double  time)
virtual

Updates alpha fade based on time.

Parameters
timeThe current simulation time.
virtual void makVrv::DtGroundFogPatch::cullUpdate ( const osg::Vec3d &  camPos,
DtJobSplitter jobSplitter 
)
virtual

Prepares the patch for drawing bsed on the camera position.

Parameters
camPosThe camera position in fog system space.
jobSplitterA job splitter to add predraw jobs to.
virtual void makVrv::DtGroundFogPatch::setTransform ( const osg::Vec3d &  position)
virtual

Sets the transform for the patch.

Parameters
positionThe transform position in fog system space.
virtual const osg::Vec3d& makVrv::DtGroundFogPatch::position ( ) const
virtual

Returns the position of the patch transform.

virtual const float* makVrv::DtGroundFogPatch::skeleton ( ) const
virtual

Returns the skeletal grid used to bend the patch mesh.

virtual void makVrv::DtGroundFogPatch::getBonePosition ( int  boneIndex,
float  patchSize,
osg::Vec3d &  position 
)
virtual

Gets a skeletal grid bone position.

Parameters
boneIndexThe index of the bone to get the position for.
patchSizeThe world space size of 1 row of the patch.
positionThe filled out position.
virtual void makVrv::DtGroundFogPatch::setBoneHeight ( int  boneIndex,
float  height 
)
virtual

Sets a skeletal grid bone height.

Parameters
boneIndexThe index of the bone to set the height for.
heightThe height to set.
virtual void makVrv::DtGroundFogPatch::setDesiredAlphaFade ( float  value)
virtual

Sets the desired alpha fade to blend to over time.

Parameters
valueThe alpha value to set in the (0-1) range.
virtual void makVrv::DtGroundFogPatch::setAlphaFade ( float  value)
virtual

Sets the alpha fade parameter used for lod.

Parameters
valueThe alpha value to set in the (0-1) range.
virtual float makVrv::DtGroundFogPatch::alphaFade ( ) const
virtual

Returns the alpha fade parameter used for lod.

virtual void makVrv::DtGroundFogPatch::SetCulled ( bool  culled)
virtual

Sets the culled state for this patch.

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

Returns the culled state for this patch.

virtual void makVrv::DtGroundFogPatch::setBoneHeightExtents ( float  min,
float  max 
)
virtual

Sets the computed minimum maximum bone offsets.

Parameters
minThe minimum offset value.
maxThe maximum offset value.
virtual void makVrv::DtGroundFogPatch::getBoneHeightExtents ( float &  min,
float &  max 
)
virtual

Gets the computed minimum maximum bone offsets.

Parameters
minThe minimum offset value.
maxThe maximum offset value.
virtual void makVrv::DtGroundFogPatch::computeBoneHeightExtents ( )
virtual

Computes the minimum maximum bone offsets.

virtual void makVrv::DtGroundFogPatch::runSort ( const osg::Vec3 &  localCamPos)
virtual

Sorts cells for the current view.

Fills indice buffer.

Parameters
localCamPosThe local camera position.
virtual void makVrv::DtGroundFogPatch::computeSortDepth ( const osg::Vec3 &  camPos)
protectedvirtual

Computes the sort depth for all cells.

Parameters
campPosThe camera position in local patch space.
virtual void makVrv::DtGroundFogPatch::fillSortedIndices ( )
protectedvirtual

Fills the indice buffer with sorted indices.

void makVrv::DtGroundFogPatch::freeData ( void  )
private

frees resources (used in destructor)

static int makVrv::DtGroundFogPatch::theSortBackToFront ( const void *  arg0,
const void *  arg1 
)
staticprivate

sort function used for qsorting cells

static void makVrv::DtGroundFogPatch::theSortJob ( void *  data)
staticprivate

sort job function used as a callback for job splitting

Member Data Documentation

int makVrv::DtGroundFogPatch::mySortDepth
unsigned short makVrv::DtGroundFogPatch::myIndiceCount
protected
unsigned short* makVrv::DtGroundFogPatch::myIndices
protected
Cell* makVrv::DtGroundFogPatch::myCells
protected
int makVrv::DtGroundFogPatch::myCellCount
protected
osg::Vec3d makVrv::DtGroundFogPatch::myPosition
protected
double makVrv::DtGroundFogPatch::myLastTime
protected
float makVrv::DtGroundFogPatch::myAlphaFade
protected
float makVrv::DtGroundFogPatch::myAlphaFadeDesired
protected
bool makVrv::DtGroundFogPatch::myCulled
protected
float makVrv::DtGroundFogPatch::myBoneHeightMin
protected
float makVrv::DtGroundFogPatch::myBoneHeightMax
protected
float makVrv::DtGroundFogPatch::mySkeleton[9]
protected
SortJobData makVrv::DtGroundFogPatch::mySortJobData
protected
DtJobSplitterJob makVrv::DtGroundFogPatch::mySortJob
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)