Get vertices & indices from btBvhTriangleMesh

h[Oz]
Posts: 6
Joined: Thu Aug 29, 2013 11:49 am

Get vertices & indices from btBvhTriangleMesh

Post by h[Oz] »

Hello, ,

I'm sorry for this noob question, but I can't find a way to get the vertices and indices of a body created with btBvhTriangleMeshShape.
For the moment, I'm passing directly my vertices to the renderer basic OpenGL), but it doesn't seem elegant...

Is the a way to

Code: Select all

btBvhTriangleMeshShape *_mesh = (btBvhTriangleMeshShape *)body->getCollisionShape();
_mesh->getVertices();
?

Thank you !
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Get vertices & indices from btBvhTriangleMesh

Post by Flix »

Code: Select all

const btStridingMeshInterface* mi = _mesh->getMeshInterface();
Now you can query the mesh interface for vertices/indices (see <btStridingMeshInterface.h>).