VR-Forces Developer's Guide
 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. 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.

Classes

struct  Cell
 
struct  SortJobData
 

Public Member Functions

 DtGroundFogPatch ()
 
virtual ~DtGroundFogPatch ()
 
virtual void init (int gridSize, float patchSize)
 
virtual void draw (osg::RenderInfo &renderInfo) const
 
virtual void updateAlphaFade (double time)
 
virtual void cullUpdate (const osg::Vec3d &camPos, DtJobSplitter *jobSplitter)
 
virtual void setTransform (const osg::Vec3d &position)
 
virtual const osg::Vec3d & position () const
 
virtual const float * skeleton () const
 
virtual void getBonePosition (int boneIndex, float patchSize, osg::Vec3d &position)
 
virtual void setBoneHeight (int boneIndex, float height)
 
virtual void setDesiredAlphaFade (float value)
 
virtual void setAlphaFade (float value)
 
virtual float alphaFade () const
 
virtual void SetCulled (bool culled)
 
virtual bool culled () const
 
virtual void setBoneHeightExtents (float min, float max)
 
virtual void getBoneHeightExtents (float &min, float &max)
 
virtual void computeBoneHeightExtents ()
 
virtual void runSort (const osg::Vec3 &localCamPos)
 

Public Attributes

int mySortDepth
 

Protected Member Functions

virtual void computeSortDepth (const osg::Vec3 &camPos)
 
virtual void fillSortedIndices ()
 

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)
 
DtGroundFogPatchoperator= (const DtGroundFogPatch &other)
 
void freeData (void)
 

Static Private Member Functions

static int theSortBackToFront (const void *arg0, const void *arg1)
 
static void theSortJob (void *data)
 

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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)