add method to add triangle by its indices for btTriangleMesh
See also https://github.com/bulletphysics/bullet3/pull/315 thanks to quiasmo for the contribution
This commit is contained in:
@@ -75,6 +75,13 @@ void btTriangleMesh::addIndex(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void btTriangleMesh::addTriangleIndices(int index1, int index2, int index3 )
|
||||
{
|
||||
m_indexedMeshes[0].m_numTriangles++;
|
||||
addIndex( index1 );
|
||||
addIndex( index2 );
|
||||
addIndex( index3 );
|
||||
}
|
||||
|
||||
int btTriangleMesh::findOrAddVertex(const btVector3& vertex, bool removeDuplicateVertices)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,10 @@ class btTriangleMesh : public btTriangleIndexVertexArray
|
||||
///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.
|
||||
void addTriangle(const btVector3& vertex0,const btVector3& vertex1,const btVector3& vertex2, bool removeDuplicateVertices=false);
|
||||
|
||||
|
||||
///Add a triangle using its indices. Make sure the indices are pointing within the vertices array, so add the vertices first (and to be sure, avoid removal of duplicate vertices)
|
||||
void addTriangleIndices(int index1, int index2, int index3 );
|
||||
|
||||
int getNumTriangles() const;
|
||||
|
||||
virtual void preallocateVertices(int numverts);
|
||||
|
||||
Reference in New Issue
Block a user