Blender V2.61 - r43446
|
#include <btTriangleMesh.h>
Public Member Functions | |
btTriangleMesh (bool use32bitIndices=true, bool use4componentVertices=true) | |
bool | getUse32bitIndices () const |
bool | getUse4componentVertices () const |
void | addTriangle (const btVector3 &vertex0, const btVector3 &vertex1, const btVector3 &vertex2, bool removeDuplicateVertices=false) |
int | getNumTriangles () const |
virtual void | preallocateVertices (int numverts) |
virtual void | preallocateIndices (int numindices) |
int | findOrAddVertex (const btVector3 &vertex, bool removeDuplicateVertices) |
findOrAddVertex is an internal method, use addTriangle instead | |
void | addIndex (int index) |
addIndex is an internal method, use addTriangle instead | |
Public Attributes | |
btScalar | m_weldingThreshold |
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 |
||
) |
Definition at line 21 of file btTriangleMesh.cpp.
References PHY_INTEGER, PHY_SHORT, and btAlignedObjectArray< T >::size().
void btTriangleMesh::addIndex | ( | int | index | ) |
addIndex is an internal method, use addTriangle instead
Definition at line 65 of file btTriangleMesh.cpp.
References btAlignedObjectArray< T >::push_back().
Referenced by addTriangle().
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.
Definition at line 125 of file btTriangleMesh.cpp.
References addIndex(), and findOrAddVertex().
Referenced by CcdShapeConstructionInfo::CreateBulletShape().
int btTriangleMesh::findOrAddVertex | ( | const btVector3 & | vertex, |
bool | removeDuplicateVertices | ||
) |
findOrAddVertex is an internal method, use addTriangle instead
Definition at line 79 of file btTriangleMesh.cpp.
References i, m_weldingThreshold, btAlignedObjectArray< T >::push_back(), and btAlignedObjectArray< T >::size().
Referenced by addTriangle().
int btTriangleMesh::getNumTriangles | ( | ) | const |
Definition at line 133 of file btTriangleMesh.cpp.
References btAlignedObjectArray< T >::size().
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.
Definition at line 39 of file btTriangleMesh.h.
Referenced by CcdShapeConstructionInfo::CreateBulletShape(), and findOrAddVertex().