A triangle mesh, also called a 'polygon soup'. More...
#include <PxTriangleMesh.h>
Public Member Functions | |
virtual PX_PHYSX_COMMON_API PxU32 | getNbVertices () const =0 |
Returns the number of vertices. More... | |
virtual PX_PHYSX_COMMON_API const PxVec3 * | getVertices () const =0 |
Returns the vertices. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | getNbTriangles () const =0 |
Returns the number of triangles. More... | |
virtual PX_PHYSX_COMMON_API const void * | getTriangles () const =0 |
Returns the triangle indices. More... | |
virtual PX_PHYSX_COMMON_API PxTriangleMeshFlags | getTriangleMeshFlags () const =0 |
Reads the PxTriangleMesh flags. More... | |
virtual PX_PHYSX_COMMON_API const PxU32 * | getTrianglesRemap () const =0 |
Returns the triangle remapping table. More... | |
virtual PX_PHYSX_COMMON_API void | release ()=0 |
Decrements the reference count of a triangle mesh and releases it if the new reference count is zero. More... | |
virtual PX_PHYSX_COMMON_API PxMaterialTableIndex | getTriangleMaterialIndex (PxTriangleID triangleIndex) const =0 |
Returns material table index of given triangle. More... | |
virtual PX_PHYSX_COMMON_API PxBounds3 | getLocalBounds () const =0 |
Returns the local-space (vertex space) AABB from the triangle mesh. More... | |
virtual PX_PHYSX_COMMON_API PxU32 | getReferenceCount () const =0 |
Returns the reference count for shared meshes. More... | |
virtual PX_PHYSX_COMMON_API const char * | getConcreteTypeName () const |
Returns string name of dynamic type. More... | |
Public Member Functions inherited from PxBase | |
template<class T > | |
T * | is () |
template<class T > | |
const T * | is () const |
PX_INLINE PxType | getConcreteType () const |
Returns concrete type of object. More... | |
PX_INLINE void | setBaseFlag (PxBaseFlag::Enum flag, bool value) |
Set PxBaseFlag. More... | |
PX_INLINE void | setBaseFlags (PxBaseFlags inFlags) |
Set PxBaseFlags. More... | |
PX_INLINE PxBaseFlags | getBaseFlags () const |
Returns PxBaseFlags. More... | |
virtual bool | isReleasable () const |
Whether the object is subordinate. More... | |
Protected Member Functions | |
PX_INLINE | PxTriangleMesh (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxTriangleMesh (PxBaseFlags baseFlags) |
virtual PX_PHYSX_COMMON_API | ~PxTriangleMesh () |
virtual PX_PHYSX_COMMON_API bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. More... | |
Protected Member Functions inherited from PxBase | |
PX_INLINE | PxBase (PxType concreteType, PxBaseFlags baseFlags) |
Constructor setting concrete type and base flags. More... | |
PX_INLINE | PxBase (PxBaseFlags baseFlags) |
Deserialization constructor setting base flags. More... | |
virtual | ~PxBase () |
Destructor. More... | |
template<class T > | |
bool | typeMatch () const |
Additional Inherited Members | |
Protected Attributes inherited from PxBase | |
PxType | mConcreteType |
PxBaseFlags | mBaseFlags |
A triangle mesh, also called a 'polygon soup'.
It is represented as an indexed triangle list. There are no restrictions on the triangle data.
To avoid duplicating data when you have several instances of a particular mesh positioned differently, you do not use this class to represent a mesh object directly. Instead, you create an instance of this mesh via the PxTriangleMeshGeometry and PxShape classes.
To create an instance of this class call PxPhysics::createTriangleMesh(), and release() to delete it. This is only possible once you have released all of its PxShape instances.
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
|
inlinevirtual |
Returns string name of dynamic type.
Reimplemented from PxBase.
|
pure virtual |
Returns the local-space (vertex space) AABB from the triangle mesh.
|
pure virtual |
Returns the number of triangles.
|
pure virtual |
|
pure virtual |
Returns the reference count for shared meshes.
At creation, the reference count of the mesh is 1. Every shape referencing this mesh increments the count by 1. When the reference count reaches 0, and only then, the mesh gets destroyed automatically.
|
pure virtual |
Returns material table index of given triangle.
This function takes a post cooking triangle index.
[in] | triangleIndex | (internal) index of desired triangle |
|
pure virtual |
Reads the PxTriangleMesh flags.
See the list of flags PxTriangleMeshFlag
|
pure virtual |
Returns the triangle indices.
The indices can be 16 or 32bit depending on the number of triangles in the mesh. Call getTriangleMeshFlags() to know if the indices are 16 or 32 bits.
The number of indices is the number of triangles * 3.
|
pure virtual |
Returns the triangle remapping table.
The triangles are internally sorted according to various criteria. Hence the internal triangle order does not always match the original (user-defined) order. The remapping table helps finding the old indices knowing the new ones:
remapTable[ internalTriangleIndex ] = originalTriangleIndex
|
pure virtual |
|
inlineprotectedvirtual |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxBase.
References PxBase::isKindOf().
|
pure virtual |
Decrements the reference count of a triangle mesh and releases it if the new reference count is zero.
The mesh is destroyed when the application's reference is released and all shapes referencing the mesh are destroyed.
Implements PxBase.