I can beautifully create btBvhTriangleMeshShape-s in my app, passing in mTriangleIndexVertexArray like this:
Code: Select all
mTriangleIndexVertexArray = new btTriangleIndexVertexArray(int)(mVertexIndexes.size()/3), //number of triangle faces
(int*)&mVertexIndexes[0], //index array
(int)(3*sizeof(vInt)), //index stride
(int)mVertexPositions.size(), //number of vertexes
(btScalar*)&mVertexPositions[0].x, //vertex array
(int)sizeof(cVec3) );
mCollisionShape = new btBvhTriangleMeshShape( [b]mTriangleIndexVertexArray[/b], true, true );
Without any drastic changes to BULLETT code, how can I achive to pass in a UNSIGNED SHORT type indexes to btTriangleIndexVertexArray?
(btTriangleMesh has such related constructor info, but no idea how to utilize it).
How do you guys would do this?