#include <GeometryHandlers.h>
Public Member Functions | |
MeshHandler (const osg::Geometry *pGfxGeometry) | |
Builds a mesh handler from an existing geometry (do not copy data). | |
MeshHandler (osg::Node *pModel) | |
Convinience constructor that builds a mesh handler using a copy of the first geometry of the given node. | |
MeshHandler (const osg::HeightField *pGfxHeightField) | |
Builds a mesh handler by copying a height field into an internal geometry. | |
virtual EGeomType | type () const |
const osg::Geometry * | getGeometry () const |
osg::Geometry * | DEBUG_getOwnGeometry () |
ONLY TO DEBUG HEIGHTFIELDS - MUST NOT BE USED FOR ANYTHING ELSE THAN DEBUG. | |
void | clearCache () |
Should be called each step (before world step) for trimesh collisions. | |
virtual UINT | getADOverrideFlag () |
Gets the auto-disable override flag (default is no override - can be overloaded in derivates). The method returns which parameters can be overriden by the geometry. | |
virtual UINT | getADSteps () |
virtual UINT | getADSamplesCount () |
virtual dReal | getADLinearThreshold () |
virtual dReal | getADAngularThreshold () |
virtual GeometryHandler * | clone () const |
Protected Types | |
typedef osg::TemplateIndexArray < GLuint, osg::Array::UIntArrayType, sizeof(GLuint), GL_UNSIGNED_INT > | TIndexArray |
Protected Member Functions | |
virtual dGeomID | create (dSpaceID spaceId) |
template<class TDrawElements > | |
void | indexAdd (const osg::PrimitiveSet *pPrimitive) |
void | indexTriangles (UINT lengthPrimitive, UINT offset) |
void | indexTriangleStrip (UINT lengthPrimitive, UINT offset) |
void | indexTriangleFan (UINT lengthPrimitive, UINT offset) |
void | indexQuads (UINT lengthPrimitive, UINT offset) |
void | indexQuadStrip (UINT lengthPrimitive, UINT offset) |
template<class TDrawElements > | |
void | indexTriangles (const TDrawElements *pPrimitive) |
template<class TDrawElements > | |
void | indexTriangleStrip (const TDrawElements *pPrimitive) |
template<class TDrawElements > | |
void | indexTriangleFan (const TDrawElements *pPrimitive) |
template<class TDrawElements > | |
void | indexQuads (const TDrawElements *pPrimitive) |
template<class TDrawElements > | |
void | indexQuadStrip (const TDrawElements *pPrimitive) |
template<class TDrawElements > | |
void | indexByType (const osg::PrimitiveSet *pPrimitive) |
Calls appropriate index*<>(const TDrawElements *). | |
virtual | ~MeshHandler () |
Protected Attributes | |
const osg::Geometry * | pGeo |
dTriMeshDataID | meshDataId |
osg::ref_ptr< TIndexArray > | pLocalIndexArray |
Private Attributes | |
osg::ref_ptr< osg::Geometry > | pOwnGeo |
Definition at line 389 of file GeometryHandlers.h.
typedef osg::TemplateIndexArray< GLuint, osg::Array::UIntArrayType, sizeof(GLuint), GL_UNSIGNED_INT > Physics::MeshHandler::TIndexArray [protected] |
Definition at line 439 of file GeometryHandlers.h.
Physics::MeshHandler::MeshHandler | ( | const osg::Geometry * | pGfxGeometry | ) | [inline] |
Builds a mesh handler from an existing geometry (do not copy data).
Definition at line 392 of file GeometryHandlers.h.
Physics::MeshHandler::MeshHandler | ( | osg::Node * | pModel | ) |
Convinience constructor that builds a mesh handler using a copy of the first geometry of the given node.
Dev note: Sorry but the Node *
cannot be const
since the constructor uses a visitor and OSG doesn't implement accept() for const nodes.
Definition at line 384 of file GeometryHandlers.cpp.
References meshDataId, pGeo, pOwnGeo, THROW_TRACED_EXCEPTION, and FindGeometriesVisitor::vFoundGeometries.
Physics::MeshHandler::MeshHandler | ( | const osg::HeightField * | pGfxHeightField | ) |
Builds a mesh handler by copying a height field into an internal geometry.
Definition at line 395 of file GeometryHandlers.cpp.
References meshDataId, pGeo, pOwnGeo, and V.
virtual Physics::MeshHandler::~MeshHandler | ( | ) | [inline, protected, virtual] |
Definition at line 468 of file GeometryHandlers.h.
void Physics::MeshHandler::clearCache | ( | ) | [inline] |
Should be called each step (before world step) for trimesh collisions.
Definition at line 410 of file GeometryHandlers.h.
virtual GeometryHandler* Physics::MeshHandler::clone | ( | ) | const [inline, virtual] |
Implements Physics::GeometryHandler.
Definition at line 430 of file GeometryHandlers.h.
References THROW_TRACED_EXCEPTION.
dGeomID Physics::MeshHandler::create | ( | dSpaceID | spaceId | ) | [protected, virtual] |
Implements Physics::GeometryHandler.
Definition at line 260 of file GeometryHandlers.cpp.
References ASSERT, indexQuads(), indexQuadStrip(), indexTriangleFan(), indexTriangles(), indexTriangleStrip(), LOG_INFO, LOG_NOTICE, LOG_WARN, meshDataId, pGeo, pLocalIndexArray, and THROW_TRACED_EXCEPTION.
osg::Geometry* Physics::MeshHandler::DEBUG_getOwnGeometry | ( | ) | [inline] |
ONLY TO DEBUG HEIGHTFIELDS - MUST NOT BE USED FOR ANYTHING ELSE THAN DEBUG.
Definition at line 405 of file GeometryHandlers.h.
dReal Physics::MeshHandler::getADAngularThreshold | ( | ) | [virtual] |
dReal Physics::MeshHandler::getADLinearThreshold | ( | ) | [virtual] |
UINT Physics::MeshHandler::getADOverrideFlag | ( | ) | [virtual] |
Gets the auto-disable override flag (default is no override - can be overloaded in derivates). The method returns which parameters can be overriden by the geometry.
Reimplemented from Physics::GeometryHandler.
Definition at line 483 of file GeometryHandlers.cpp.
References Physics::GeometryHandler::AD_ANGULAR, Physics::GeometryHandler::AD_LINEAR, Physics::GeometryHandler::AD_SAMPLES_COUNT, and Physics::GeometryHandler::AD_STEPS.
UINT Physics::MeshHandler::getADSamplesCount | ( | ) | [virtual] |
UINT Physics::MeshHandler::getADSteps | ( | ) | [virtual] |
const osg::Geometry* Physics::MeshHandler::getGeometry | ( | ) | const [inline] |
void Physics::MeshHandler::indexAdd | ( | const osg::PrimitiveSet * | pPrimitive | ) | [inline, protected] |
void Physics::MeshHandler::indexByType | ( | const osg::PrimitiveSet * | pPrimitive | ) | [inline, protected] |
Calls appropriate index*<>(const TDrawElements *).
Definition at line 246 of file GeometryHandlers.cpp.
References THROW_TRACED_EXCEPTION.
void Physics::MeshHandler::indexQuads | ( | const TDrawElements * | pPrimitive | ) | [inline, protected] |
Definition at line 159 of file GeometryHandlers.cpp.
References pLocalIndexArray.
Referenced by create().
void Physics::MeshHandler::indexQuadStrip | ( | const TDrawElements * | pPrimitive | ) | [inline, protected] |
Definition at line 201 of file GeometryHandlers.cpp.
References pLocalIndexArray.
Referenced by create().
void Physics::MeshHandler::indexTriangleFan | ( | const TDrawElements * | pPrimitive | ) | [inline, protected] |
Definition at line 127 of file GeometryHandlers.cpp.
References pLocalIndexArray.
Referenced by create().
void Physics::MeshHandler::indexTriangles | ( | const TDrawElements * | pPrimitive | ) | [inline, protected] |
Definition at line 66 of file GeometryHandlers.cpp.
References pLocalIndexArray.
Referenced by create().
void Physics::MeshHandler::indexTriangleStrip | ( | const TDrawElements * | pPrimitive | ) | [inline, protected] |
Definition at line 81 of file GeometryHandlers.cpp.
References pLocalIndexArray.
Referenced by create().
virtual EGeomType Physics::MeshHandler::type | ( | ) | const [inline, virtual] |
dTriMeshDataID Physics::MeshHandler::meshDataId [protected] |
const osg::Geometry* Physics::MeshHandler::pGeo [protected] |
osg::ref_ptr<TIndexArray> Physics::MeshHandler::pLocalIndexArray [protected] |
Definition at line 440 of file GeometryHandlers.h.
Referenced by create(), indexQuads(), indexQuadStrip(), indexTriangleFan(), indexTriangles(), and indexTriangleStrip().
osg::ref_ptr<osg::Geometry> Physics::MeshHandler::pOwnGeo [private] |