Collision between static and dynamic triangle meshes

Kurtz79
Posts: 2
Joined: Thu Apr 22, 2010 7:01 pm

Collision between static and dynamic triangle meshes

Post by Kurtz79 »

Hello everybody,

I'm just starting with Bullet... I have some triangle meshes exported from Blender, and I built upon the helloworld example in order to draw some shapes and link them to some bullet rigidbodies.

At the moment I have a static mesh rigidbody (mass == 0), representing terrain, and three dynamic (mass != 0) object rigidbodies, all declared as btBvhTriangleMeshShape taking a btTriangleMesh as input. The objects could be actually represented by spheres, but for the sake of argument I kept them as triangle meshes.

I set the gravity, put the spheres above the origin and they graciously fall, THROUGH the static terrain.

If I set the terrain as a rough btBoxShape it works fine, and the spheres correctly collide between themselves as well. If I declare the terrain as a dynamic rigidbody (mass != 0) and put a dummy btBoxShape below it works as well . The problem I have is only trying to detect collisions between static and dynamic btBvhTriangleMeshShape.

What am I doing wrong ?

Thanks for your help.

Vince
Last edited by Kurtz79 on Thu Apr 22, 2010 7:30 pm, edited 1 time in total.
chrozz
Posts: 8
Joined: Fri Mar 12, 2010 10:21 pm

Re: Collision between static and dynamic triangle meshes

Post by chrozz »

I may be mistaken , but I don't think you can do it that way.

See the convex decomposition demo in "bullet path/ Extras/ConvexDecomposition"
on how to decompose your tri mesh into a btCompoundShape.
Kurtz79
Posts: 2
Joined: Thu Apr 22, 2010 7:01 pm

Re: Collision between static and dynamic triangle meshes

Post by Kurtz79 »

chrozz wrote:I may be mistaken , but I don't think you can do it that way.

See the convex decomposition demo in "bullet path/ Extras/ConvexDecomposition"
on how to decompose your tri mesh into a btCompoundShape.
I'll have a look, thanks :)