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!
Concave - concave collision detection
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: Concave - concave collision detection
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.gigel_ranga wrote: This looks like mesh against mesh collision is not implemented (yet). Is this correct? Any other ways of doing it?
Use btGImpactShape instead for collision detection between two concave triangle meshes. See Bullet/Demos/MovingConcaveDemo or Bullet/Demos/GimpactTestDemo.
Hope this helps,
Erwin
-
- Posts: 2
- Joined: Tue Dec 02, 2008 10:10 pm
Re: Concave - concave collision detection
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!
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!