applied patch contributed by Tim Johansson: adds support for multiple mesh parts in combination with bvh, add short index support for meshes.

This commit is contained in:
ejcoumans
2007-11-06 06:47:04 +00:00
parent 47afa86482
commit 282cbdcdd9
5 changed files with 39 additions and 14 deletions

View File

@@ -34,7 +34,10 @@ ATTRIBUTE_ALIGNED16( struct) btIndexedMesh
int m_numVertices;
const unsigned char * m_vertexBase;
int m_vertexStride;
int pad[2];
// The index type is set when adding an indexed mesh to the
// btTriangleIndexVertexArray, do not set it manually
PHY_ScalarType m_indexType;
int pad;
}
;
@@ -64,9 +67,10 @@ public:
//just to be backwards compatible
btTriangleIndexVertexArray(int numTriangleIndices,int* triangleIndexBase,int triangleIndexStride,int numVertices,btScalar* vertexBase,int vertexStride);
void addIndexedMesh(const btIndexedMesh& mesh)
void addIndexedMesh(const btIndexedMesh& mesh, PHY_ScalarType indexType = PHY_INTEGER)
{
m_indexedMeshes.push_back(mesh);
m_indexedMeshes[m_indexedMeshes.size()-1].m_indexType = indexType;
}