Triangle mesh question

ill
Posts: 7
Joined: Sat Jan 29, 2011 4:14 am

Triangle mesh question

Post by ill »

So in our game I use vertex arrays to render the level, and also use the same data structure to pass to the btBvhTriangleMesh object. I use the btTriangleIndexVertexArray to initialize it right now. One thing about rendering with vertex arrays is that I have to have multiple sets of vertex positions if there are different normals for the faces that connect to that vertex. At the moment I'm keeping the vertex positions compact and don't have copies of vertex positions when I pass it to the btTriangleIndexVertexArray object.

I'm just wondering, does the TriangleMesh collision shape also do this? Does it take the verteces I give it and construct many copies of the same vertex position for the different triangles? Or does it convert the whole thing into planes or something? Is it safe to delete the triangle mesh data I pass it to construct the triangle mesh shape?