how to get vertex and index data from btTriangleMesh ?

going
Posts: 13
Joined: Thu Oct 23, 2008 3:04 am

how to get vertex and index data from btTriangleMesh ?

Post by going »

Hi, I'm now using bullet and irrlicht to make some softbody application.

and I can convert from irrlicht mesh to btTriangleMesh* data.

But I don't know how to make vertex and index data from btTriangleMesh data to use it in CreateFromTriMesh

Code: Select all

btSoftBodyHelpers::CreateFromTriMesh(btSoftBodyWorldInfo& worldInfo,const btScalar*	vertices,
								  const int* triangles,
								  int ntriangles)
because it is private data and have no read access function.

Is there any way to use CreateFromTriMesh from btTriangleMesh ?

Thanks
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: how to get vertex and index data from btTriangleMesh ?

Post by Erwin Coumans »

For your purpose, it is better to avoid using btTriangleMesh.

Please try using the btTriangleIndexVertexArray, and share vertex and index array between Irrlich and Bullet.

Hope this helps,
Erwin
going
Posts: 13
Joined: Thu Oct 23, 2008 3:04 am

Re: how to get vertex and index data from btTriangleMesh ?

Post by going »

Thanks for your first reply!!

I'll try it

thank you