#include <btTriangleMesh.h>
Public Member Functions | |
void | addIndex (int index) |
addIndex is an internal method, use addTriangle instead | |
void | addTriangle (const btVector3 &vertex0, const btVector3 &vertex1, const btVector3 &vertex2, bool removeDuplicateVertices=false) |
btTriangleMesh (bool use32bitIndices=true, bool use4componentVertices=true) | |
int | findOrAddVertex (const btVector3 &vertex, bool removeDuplicateVertices) |
findOrAddVertex is an internal method, use addTriangle instead | |
int | getNumTriangles () const |
bool | getUse32bitIndices () const |
bool | getUse4componentVertices () const |
virtual void | preallocateIndices (int numindices) |
virtual void | preallocateVertices (int numverts) |
Public Attributes | |
btScalar | m_weldingThreshold |
Private Attributes | |
btAlignedObjectArray< unsigned short int > | m_16bitIndices |
btAlignedObjectArray< unsigned int > | m_32bitIndices |
btAlignedObjectArray< float > | m_3componentVertices |
btAlignedObjectArray< btVector3 > | m_4componentVertices |
bool | m_use32bitIndices |
bool | m_use4componentVertices |
The btTriangleMesh class is a convenience class derived from btTriangleIndexVertexArray, that provides storage for a concave triangle mesh. It can be used as data for the btBvhTriangleMeshShape. It allows either 32bit or 16bit indices, and 4 (x-y-z-w) or 3 (x-y-z) component vertices. If you want to share triangle/index data between graphics mesh and collision mesh (btBvhTriangleMeshShape), you can directly use btTriangleIndexVertexArray or derive your own class from btStridingMeshInterface. Performance of btTriangleMesh and btTriangleIndexVertexArray used in a btBvhTriangleMeshShape is the same.
Definition at line 27 of file btTriangleMesh.h.
btTriangleMesh::btTriangleMesh | ( | bool | use32bitIndices = true , |
bool | use4componentVertices = true |
||
) |
void btTriangleMesh::addIndex | ( | int | index | ) |
addIndex is an internal method, use addTriangle instead
void btTriangleMesh::addTriangle | ( | const btVector3 & | vertex0, |
const btVector3 & | vertex1, | ||
const btVector3 & | vertex2, | ||
bool | removeDuplicateVertices = false |
||
) |
By default addTriangle won't search for duplicate vertices, because the search is very slow for large triangle meshes. In general it is better to directly use btTriangleIndexVertexArray instead.
int btTriangleMesh::findOrAddVertex | ( | const btVector3 & | vertex, |
bool | removeDuplicateVertices | ||
) |
findOrAddVertex is an internal method, use addTriangle instead
int btTriangleMesh::getNumTriangles | ( | ) | const |
bool btTriangleMesh::getUse32bitIndices | ( | ) | const [inline] |
Definition at line 43 of file btTriangleMesh.h.
bool btTriangleMesh::getUse4componentVertices | ( | ) | const [inline] |
Definition at line 48 of file btTriangleMesh.h.
virtual void btTriangleMesh::preallocateIndices | ( | int | numindices | ) | [inline, virtual] |
Definition at line 59 of file btTriangleMesh.h.
virtual void btTriangleMesh::preallocateVertices | ( | int | numverts | ) | [inline, virtual] |
Definition at line 58 of file btTriangleMesh.h.
btAlignedObjectArray<unsigned short int> btTriangleMesh::m_16bitIndices [private] |
Definition at line 33 of file btTriangleMesh.h.
btAlignedObjectArray<unsigned int> btTriangleMesh::m_32bitIndices [private] |
Definition at line 32 of file btTriangleMesh.h.
btAlignedObjectArray<float> btTriangleMesh::m_3componentVertices [private] |
Definition at line 30 of file btTriangleMesh.h.
btAlignedObjectArray<btVector3> btTriangleMesh::m_4componentVertices [private] |
Definition at line 29 of file btTriangleMesh.h.
bool btTriangleMesh::m_use32bitIndices [private] |
Definition at line 34 of file btTriangleMesh.h.
bool btTriangleMesh::m_use4componentVertices [private] |
Definition at line 35 of file btTriangleMesh.h.
Definition at line 39 of file btTriangleMesh.h.