How to check if convex bodies are colliding with each other?
-
- Posts: 31
- Joined: Sat Jul 23, 2011 4:24 pm
How to check if convex bodies are colliding with each other?
I placed some rigid bodies in my world and I need to test if they are colliding with each other before calling stepSimulation. How do I do this?
-
- Posts: 237
- Joined: Tue Jun 29, 2010 10:27 pm
Re: How to check if convex bodies are colliding with each ot
To test for collision with specific objects...
To test collision between a specific pair of objects:
To test for for collision between one specific object and all other objects:
http://bulletphysics.com/Bullet/BulletF ... 7b36a640c8
http://bulletphysics.com/Bullet/BulletF ... 18f8480999
I'm not certain how to do a generic collision detection between all pairs of objects between simulation steps. Perhaps btCollisionWorld::performDiscreteCollisionDetection(), but I am not familiar with it.
To test collision between a specific pair of objects:
Code: Select all
void btCollisionWorld::contactPairTest (btCollisionObject *colObjA, btCollisionObject *colObjB, ContactResultCallback &resultCallback)
Code: Select all
void btCollisionWorld::contactTest (btCollisionObject *colObj, ContactResultCallback &resultCallback)
http://bulletphysics.com/Bullet/BulletF ... 18f8480999
I'm not certain how to do a generic collision detection between all pairs of objects between simulation steps. Perhaps btCollisionWorld::performDiscreteCollisionDetection(), but I am not familiar with it.