Concave - concave collision detection

Post Reply
gigel_ranga
Posts: 2
Joined: Tue Dec 02, 2008 10:10 pm

Concave - concave collision detection

Post by gigel_ranga » Tue Dec 02, 2008 10:26 pm

I am trying to do collision detection between (concave) triangle soups. I have set up the following:

- a btCollisionWorld
- a couple of btObjects
- for each object, I set the shape using a btBvhTriangleMeshShape which has been created using a btTriangleMesh populated with the triangles that I need

When I call performDiscreteCollisionDetection, the call eventually ends up in btCollisionDispatcher::defaultNearCallback which tries to find the right algorithm for my objects. However, it chooses btEmptyAlgorithm::processCollision which does nothing.

This looks like mesh against mesh collision is not implemented (yet). Is this correct? Any other ways of doing it?

Thanks a lot!

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

Re: Concave - concave collision detection

Post by Erwin Coumans » Wed Dec 03, 2008 6:43 pm

gigel_ranga wrote: This looks like mesh against mesh collision is not implemented (yet). Is this correct? Any other ways of doing it?
Mesh versus mesh is not implemented for btBvhTriangleMeshShape, because btBvhTriangleMeshShape is supposed to be used only for 'static' world geometry without collision detection between static versus static.

Use btGImpactShape instead for collision detection between two concave triangle meshes. See Bullet/Demos/MovingConcaveDemo or Bullet/Demos/GimpactTestDemo.

Hope this helps,
Erwin

gigel_ranga
Posts: 2
Joined: Tue Dec 02, 2008 10:10 pm

Re: Concave - concave collision detection

Post by gigel_ranga » Wed Dec 03, 2008 11:20 pm

Thanks for the reply. Simply using btGImpactMeshShape did not help, but then adding

btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher);

did the trick.

Now for the next step, is there any way to compute the distance between two triangle meshes (which are not colliding)? Ideally, I would also need the point on each object that is closest to the other object.

Thanks again!

Post Reply