![]() |
VR-Forces 4.10 Class Documentation
|
Used by the weather system to define a rectangular grid of points. More...

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 int * | packedData (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 | |
| DtDe & | myDe |
| int | myClampIndex |
| float | myMinClampOffset |
| float | myMaxClampOffset |
| osg::Vec3d | myPosition |
| osg::Matrixd | myRotation |
| float | myBoundsX |
| float | myBoundsY |
| int | myPointCountX |
| int | myPointCountY |
| float * | myHeights |
| unsigned int * | myPackedData |
Private Member Functions | |
| DtWeatherSurfaceGrid ()=delete | |
| Default Constructor not implemented. More... | |
| DtWeatherSurfaceGrid (const DtWeatherSurfaceGrid &other)=delete | |
| Copy Constructor not implemented - Copy not allowed. More... | |
| DtWeatherSurfaceGrid & | operator= (const DtWeatherSurfaceGrid &other)=delete |
| Assignment Operator not implemented - Assignment not allowed. More... | |
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.
| makVrv::DtWeatherSurfaceGrid::DtWeatherSurfaceGrid | ( | makVrv::DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
|
privatedelete |
Default Constructor not implemented.
|
privatedelete |
Copy Constructor not implemented - Copy not allowed.
|
privatedelete |
Assignment Operator not implemented - Assignment not allowed.
|
virtual |
Sets the rectangular bounds of the area.
| boundsX | The x size of the bounds. |
| boundsY | The y size of the bounds. |
Sets the number of points in the x and y directions of the grid.
Calling this method re-creates the grid.
| sizeX | The x count of points on the rectangular grid (must be > 1). |
| sizeY | The y count of points on the rectangular grid (must be > 1). |
|
virtual |
Sets the grid transform.
| position | The transform position in world space. |
| rotation | The transform rotation in world space. |
|
virtual |
Returns the grid heights array used for terrain clamping.
| sizeX | Filled in output for the grid size in the x direction. |
| sizeY | Filled in output for the grid size in the y direction. |
|
virtual |
Returns the grid heights/blend packedData array used for terrain clamping.
| sizeX | Filled in output for the grid size in the x direction. |
| sizeY | Filled in output for the grid size in the y direction. |
|
virtual |
Gets a grid 3D position at the given grid index.
| gridX | The X grid index to get the position for. |
| gridY | The Y grid index to get the position for. |
| position | The filled out position. |
|
virtual |
Returns the distance used for clamping to the terrain.
|
virtual |
Clamps the given position to the terrain surface.
Returns true if successful.
| position | The input/output position to clamp. |
| clampDistance | The above/below distance to search for a surface. |
|
virtual |
Updates the grid clamping.
Returns false when all points have been clamped and no more updates are required.
| timeStep | The update timestep. |
|
virtual |
Called to indicate the area bounds or transform has changed.
This will reset the clamping process.
|
virtual |
Returns the minimum calculated clamp offset value.
|
virtual |
Returns the maximum calculated clamp offset value.
|
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.
|
protectedvirtual |
Packs the given height and blend values into an unsigned int.
| height | A height value stored in 24 bits. |
| blend | A blend value in the range of (0.0f to 1.0f) stored in 8 bits. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |