#include <GeometryHandlers.h>
Public Member Functions | |
HeightFieldHandler (const osg::HeightField *pGfxHeightField, float thickness=1, const graphVec3 &offset_from_graph=graphVec3(0, 0, 0), bool bWarp=false) | |
Builds a height field geometry handler from a graphical height field. | |
HeightFieldHandler (const HeightFieldHandler &hf) | |
Copy constructor used for clone() method. | |
virtual EGeomType | type () const |
virtual GeometryHandler * | clone () const |
Protected Member Functions | |
virtual dGeomID | create (dSpaceID spaceId) |
virtual | ~HeightFieldHandler () |
Protected Attributes | |
float * | pData |
Raw data. | |
float | width |
float | depth |
Size of the height field. | |
UINT | widthSamples |
UINT | depthSamples |
Number of points in the height field. | |
float | scale |
float | offset |
float | thickness |
bool | bPlaceable |
bool | bWarp |
dVector3 | pos |
Initial position. | |
dQuaternion | rot |
Initial rotation. | |
dHeightfieldDataID | idHFData |
Data object for height field. | |
dGeomID | idHF |
Height field itself (will be encapsulated in a transform). |
Used for terrains that do not morph often (= a data copy is needed each time you change height data).
Definition at line 340 of file GeometryHandlers.h.
Physics::HeightFieldHandler::HeightFieldHandler | ( | const osg::HeightField * | pGfxHeightField, | |
float | thickness = 1 , |
|||
const graphVec3 & | offset_from_graph = graphVec3(0,0,0) , |
|||
bool | bWarp = false | |||
) |
Builds a height field geometry handler from a graphical height field.
pGfxHeightField | Graphical height field to copy data from. | |
thickness | Volume size added at the bottom of the height field (from the lowest point) to ensure collisions are detected if a geom pass throught the height field. | |
offset_from_graph | Offset from the pGfxHeightField, if needed (Ex: to put the physics slightly ontop of the graphics). | |
bWarp | true to repeat the height field infinitely. |
Definition at line 567 of file GeometryHandlers.cpp.
References ASSERT, depth, depthSamples, graphVec3, idHFData, pData, pos, rot, Physics::toPhyQuat(), Physics::toPhyVec3(), width, and widthSamples.
Physics::HeightFieldHandler::HeightFieldHandler | ( | const HeightFieldHandler & | hf | ) |
Copy constructor used for clone() method.
Definition at line 595 of file GeometryHandlers.cpp.
References ASSERT, depthSamples, idHFData, pData, pos, rot, and widthSamples.
virtual Physics::HeightFieldHandler::~HeightFieldHandler | ( | ) | [inline, protected, virtual] |
Definition at line 379 of file GeometryHandlers.h.
virtual GeometryHandler* Physics::HeightFieldHandler::clone | ( | ) | const [inline, virtual] |
dGeomID Physics::HeightFieldHandler::create | ( | dSpaceID | spaceId | ) | [protected, virtual] |
Implements Physics::GeometryHandler.
Definition at line 620 of file GeometryHandlers.cpp.
References bPlaceable, bWarp, depth, depthSamples, dGeomSetPosition(), dGeomSetRotation(), graphMat, graphQuat, Physics::GeometryHandler::id, idHF, idHFData, offset, pData, pos, rot, scale, thickness, Physics::toGraphQuat(), Physics::toPhyMatRotation(), width, and widthSamples.
virtual EGeomType Physics::HeightFieldHandler::type | ( | ) | const [inline, virtual] |
bool Physics::HeightFieldHandler::bPlaceable [protected] |
bool Physics::HeightFieldHandler::bWarp [protected] |
float Physics::HeightFieldHandler::depth [protected] |
Size of the height field.
Definition at line 370 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
UINT Physics::HeightFieldHandler::depthSamples [protected] |
Number of points in the height field.
Definition at line 371 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
dGeomID Physics::HeightFieldHandler::idHF [protected] |
Height field itself (will be encapsulated in a transform).
Definition at line 377 of file GeometryHandlers.h.
Referenced by create().
dHeightfieldDataID Physics::HeightFieldHandler::idHFData [protected] |
Data object for height field.
Definition at line 376 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
float Physics::HeightFieldHandler::offset [protected] |
float* Physics::HeightFieldHandler::pData [protected] |
Raw data.
Definition at line 369 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
dVector3 Physics::HeightFieldHandler::pos [protected] |
Initial position.
Definition at line 374 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
dQuaternion Physics::HeightFieldHandler::rot [protected] |
Initial rotation.
Definition at line 375 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
float Physics::HeightFieldHandler::scale [protected] |
float Physics::HeightFieldHandler::thickness [protected] |
float Physics::HeightFieldHandler::width [protected] |
Definition at line 370 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().
UINT Physics::HeightFieldHandler::widthSamples [protected] |
Definition at line 371 of file GeometryHandlers.h.
Referenced by create(), and HeightFieldHandler().