VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtWeatherSurfaceGrid Class Reference

Used by the weather system to define a rectangular grid of points. More...

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

Public Member Functions

 DtWeatherSurfaceGrid (makVrv::DtDe &de)
 CTOR. More...
 
virtual ~DtWeatherSurfaceGrid ()
 DTOR. More...
 
virtual void setBounds (float boundsX, float boundsY)
 Sets the rectangular bounds of the area. More...
 
virtual void setGridSize (int sizeX, int sizeY)
 Sets the number of points in the x and y directions of the grid. More...
 
virtual void setTransform (const osg::Vec3d &position, osg::Matrixd &rotation)
 Sets the grid transform. More...
 
virtual const float * heights (int &sizeX, int &sizeY) const
 Returns the grid heights array used for terrain clamping. More...
 
virtual const unsigned intpackedData (int &sizeX, int &sizeY) const
 Returns the grid heights/blend packedData array used for terrain clamping. More...
 
virtual void getPosition (int gridX, int gridY, osg::Vec3d &position)
 Gets a grid 3D position at the given grid index. More...
 
virtual double clampDistance () const
 Returns the distance used for clamping to the terrain. More...
 
virtual bool clampPositionToTerrain (osg::Vec3d &position, float clampDistance)
 Clamps the given position to the terrain surface. More...
 
virtual bool simulationUpdate (float timeStep)
 Updates the grid clamping. More...
 
virtual void onAreaChanged ()
 Called to indicate the area bounds or transform has changed. More...
 
virtual float minClampOffset () const
 Returns the minimum calculated clamp offset value. More...
 
virtual float maxClampOffset () const
 Returns the maximum calculated clamp offset value. More...
 
virtual void computeBlendingData (float maxDiffPerMeter)
 /brief Computes blending values based on grid point height differences. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Protected Member Functions

virtual unsigned int packData (float height, float blend)
 Packs the given height and blend values into an unsigned int. More...
 

Protected Attributes

DtDemyDe
 
int myClampIndex
 
float myMinClampOffset
 
float myMaxClampOffset
 
osg::Vec3d myPosition
 
osg::Matrixd myRotation
 
float myBoundsX
 
float myBoundsY
 
int myPointCountX
 
int myPointCountY
 
float * myHeights
 
unsigned intmyPackedData
 

Private Member Functions

 DtWeatherSurfaceGrid ()=delete
 Default Constructor not implemented. More...
 
 DtWeatherSurfaceGrid (const DtWeatherSurfaceGrid &other)=delete
 Copy Constructor not implemented - Copy not allowed. More...
 
DtWeatherSurfaceGridoperator= (const DtWeatherSurfaceGrid &other)=delete
 Assignment Operator not implemented - Assignment not allowed. More...
 

Detailed Description

Used by the weather system to define a rectangular grid of points.

The points can be clamped to the terrain surface for use in constraining weather effects to the terrain. The grid can be thought of as a crude surface height map. The height map has a rectangular bounds that is divided evenly by a rectangular grid.

Optionally, each grid point height can be packed with a blending value into a single unsinged int for better shader memory use.

The owner of this object should call simulationUpdate() to update clamping.

Constructor & Destructor Documentation

makVrv::DtWeatherSurfaceGrid::DtWeatherSurfaceGrid ( makVrv::DtDe de)

CTOR.

virtual makVrv::DtWeatherSurfaceGrid::~DtWeatherSurfaceGrid ( )
virtual

DTOR.

makVrv::DtWeatherSurfaceGrid::DtWeatherSurfaceGrid ( )
privatedelete

Default Constructor not implemented.

makVrv::DtWeatherSurfaceGrid::DtWeatherSurfaceGrid ( const DtWeatherSurfaceGrid other)
privatedelete

Copy Constructor not implemented - Copy not allowed.

Member Function Documentation

DtWeatherSurfaceGrid& makVrv::DtWeatherSurfaceGrid::operator= ( const DtWeatherSurfaceGrid other)
privatedelete

Assignment Operator not implemented - Assignment not allowed.

virtual void makVrv::DtWeatherSurfaceGrid::setBounds ( float  boundsX,
float  boundsY 
)
virtual

Sets the rectangular bounds of the area.

Parameters
boundsXThe x size of the bounds.
boundsYThe y size of the bounds.
virtual void makVrv::DtWeatherSurfaceGrid::setGridSize ( int  sizeX,
int  sizeY 
)
virtual

Sets the number of points in the x and y directions of the grid.

Calling this method re-creates the grid.

Parameters
sizeXThe x count of points on the rectangular grid (must be > 1).
sizeYThe y count of points on the rectangular grid (must be > 1).
virtual void makVrv::DtWeatherSurfaceGrid::setTransform ( const osg::Vec3d &  position,
osg::Matrixd &  rotation 
)
virtual

Sets the grid transform.

Parameters
positionThe transform position in world space.
rotationThe transform rotation in world space.
virtual const float* makVrv::DtWeatherSurfaceGrid::heights ( int sizeX,
int sizeY 
) const
virtual

Returns the grid heights array used for terrain clamping.

Parameters
sizeXFilled in output for the grid size in the x direction.
sizeYFilled in output for the grid size in the y direction.
virtual const unsigned int* makVrv::DtWeatherSurfaceGrid::packedData ( int sizeX,
int sizeY 
) const
virtual

Returns the grid heights/blend packedData array used for terrain clamping.

Parameters
sizeXFilled in output for the grid size in the x direction.
sizeYFilled in output for the grid size in the y direction.
virtual void makVrv::DtWeatherSurfaceGrid::getPosition ( int  gridX,
int  gridY,
osg::Vec3d &  position 
)
virtual

Gets a grid 3D position at the given grid index.

Parameters
gridXThe X grid index to get the position for.
gridYThe Y grid index to get the position for.
positionThe filled out position.
virtual double makVrv::DtWeatherSurfaceGrid::clampDistance ( ) const
virtual

Returns the distance used for clamping to the terrain.

virtual bool makVrv::DtWeatherSurfaceGrid::clampPositionToTerrain ( osg::Vec3d &  position,
float  clampDistance 
)
virtual

Clamps the given position to the terrain surface.

Returns true if successful.

Parameters
positionThe input/output position to clamp.
clampDistanceThe above/below distance to search for a surface.
virtual bool makVrv::DtWeatherSurfaceGrid::simulationUpdate ( float  timeStep)
virtual

Updates the grid clamping.

Returns false when all points have been clamped and no more updates are required.

Parameters
timeStepThe update timestep.
virtual void makVrv::DtWeatherSurfaceGrid::onAreaChanged ( )
virtual

Called to indicate the area bounds or transform has changed.

This will reset the clamping process.

virtual float makVrv::DtWeatherSurfaceGrid::minClampOffset ( ) const
virtual

Returns the minimum calculated clamp offset value.

virtual float makVrv::DtWeatherSurfaceGrid::maxClampOffset ( ) const
virtual

Returns the maximum calculated clamp offset value.

virtual void makVrv::DtWeatherSurfaceGrid::computeBlendingData ( float  maxDiffPerMeter)
virtual

/brief Computes blending values based on grid point height differences.

This packs height and blending data into the unsigned int packed data array. Blend will be linear from 1.0 at no height difference to 0.0f at maximum allowed difference. This operates on the current set of height data. /param maxDiffPerMeter The height difference per meter where blend values will be zero.

virtual unsigned int makVrv::DtWeatherSurfaceGrid::packData ( float  height,
float  blend 
)
protectedvirtual

Packs the given height and blend values into an unsigned int.

Parameters
heightA height value stored in 24 bits.
blendA blend value in the range of (0.0f to 1.0f) stored in 8 bits.

Member Data Documentation

DtDe& makVrv::DtWeatherSurfaceGrid::myDe
protected
int makVrv::DtWeatherSurfaceGrid::myClampIndex
protected
float makVrv::DtWeatherSurfaceGrid::myMinClampOffset
protected
float makVrv::DtWeatherSurfaceGrid::myMaxClampOffset
protected
osg::Vec3d makVrv::DtWeatherSurfaceGrid::myPosition
protected
osg::Matrixd makVrv::DtWeatherSurfaceGrid::myRotation
protected
float makVrv::DtWeatherSurfaceGrid::myBoundsX
protected
float makVrv::DtWeatherSurfaceGrid::myBoundsY
protected
int makVrv::DtWeatherSurfaceGrid::myPointCountX
protected
int makVrv::DtWeatherSurfaceGrid::myPointCountY
protected
float* makVrv::DtWeatherSurfaceGrid::myHeights
protected
unsigned int* makVrv::DtWeatherSurfaceGrid::myPackedData
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)