Triangle Data and Model data (JBullet)

jmbrook3
Posts: 1
Joined: Mon May 18, 2009 9:26 pm

Triangle Data and Model data (JBullet)

Post by jmbrook3 »

Hello All,

I'm a little stuck on how best to approach integrating Bullet Physics into my app. I'm using JBullet but I think that the answer for Bullet probably applies to both.

My 3D render is using EGL and requires an array of triangle vertices (where each new one joins to the previous one to for the model - standard stuff). However I'm having trouble mapping this onto the output of Bullet.

The approach so far has to be to create a TriangleIndexVertexArray (btTriangleIndexVertexArray) and add in the corresponding IndexMesh (btIndexedMesh) - this is then used to create a btConvexTriangleMeshShape. This way the IndexMesh (btIndexedMesh) data can be shared between my rendered and the physic model.

My problem is that on the IndexMesh (btIndexedMesh) I'm not completely sure about some of the parameters - maining triangleIndexBase/triangleIndexStride vs vertexBase/vertexStride? Is there any documentation that explains these?

Also on a more general point is this a sensible approach? Any other suggestions would be great.

Thanks in advance,

James