Accesing vertices from btTriangleMesh

sara
Posts: 39
Joined: Thu Mar 24, 2011 3:50 pm

Accesing vertices from btTriangleMesh

Post by sara »

Can somebody tell me how can I read all vertices positions using btTriangleMesh?

Thanks!
sara
Posts: 39
Joined: Thu Mar 24, 2011 3:50 pm

Re: Accesing vertices from btTriangleMesh

Post by sara »

Or from btBvhTriangleMeshShape?
sara
Posts: 39
Joined: Thu Mar 24, 2011 3:50 pm

Re: Accesing vertices from btTriangleMesh

Post by sara »

Anybody out there?

I'm just trying to get the positions of the vertices of my mesh at one point of the simulation.

Please?
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Accesing vertices from btTriangleMesh

Post by xexuxjy »

If it's got a striding mesh interface you can use :

getLockedVertexIndexBase
sara
Posts: 39
Joined: Thu Mar 24, 2011 3:50 pm

Re: Accesing vertices from btTriangleMesh

Post by sara »

Thank you very much for your answer!!

I'll try it out.
sara
Posts: 39
Joined: Thu Mar 24, 2011 3:50 pm

Re: Accesing vertices from btTriangleMesh

Post by sara »

The problem with getLockedVertexIndexBase is that it gives me the initial positions of the mesh, not the transformed vertices.

How can I find or calculate the current positions of the vertices?
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Accesing vertices from btTriangleMesh

Post by xexuxjy »

I don't think that it stores the transformed version of the meshes so you'd need to transform the data in the meshInterface by the worldTranform of the shape (and the rigidbody) to get the final positions in worldspace..