ContactTest for non-convex collision detection

nictosi
Posts: 11
Joined: Mon Jul 06, 2015 9:25 am

ContactTest for non-convex collision detection

Post by nictosi »

Hi all,
Is it possible to use the btCollisionWorld::contactTest() method to calculate collisions between non-convex objects?

From the doc: "contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback.
it reports one or more contact points for every overlapping object (including the one with deepest penetration) "

I have a collision object obj1 whose position may change, and I'd like to check collision wrt the world. Both obj1 and the other objects are non convex. Shall I use a particular set up for the btCollisionWorld?
nictosi
Posts: 11
Joined: Mon Jul 06, 2015 9:25 am

Re: ContactTest for non-convex collision detection

Post by nictosi »

I believe I found out the answer, so I will share it for those who are having the same issue.

As of now, Bullet doesn't support collision detection in case of moving concave meshes modelled as a btBvhTriangleMeshShape. I assume this is because the btBvhTriangleMeshShape is optimised for collision detection, paying the price of not allowing transformation changes.

As a workaround, the suggested solution is to divide your concave mesh as a set of convex meshes (see ConvexDecompositionDemo), or approximate it using its bounding circle, box or convex hull.
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: ContactTest for non-convex collision detection

Post by xexuxjy »

There are also the GImpact shapes / extensions which should also provide a moving concave mesh. Not sure how well supported it is at the moment though,