Bullet does not detect collision of 2 boxes touching corners

Post Reply
rachitjain2110
Posts: 2
Joined: Thu Jan 16, 2014 12:15 pm

Bullet does not detect collision of 2 boxes touching corners

Post by rachitjain2110 »

I have just started to use Bullet library (just the collision part, no dynamics/physics) and trying out couple of basic tests. Below is 1 cases, where I need some help:

Case: 2 Boxes

Box 1 origin is: 0 2 0 and its radius: 1 1 1
Box 2 origin is: 2 4 0 and its radius: 1 1 1
Transformation are set to Identity.

Called performDiscreteCollisionDetection (Algo: btDbvtBroadphase), : Number of contact points (manifolds) is: 0

QUESTION:
Theoretically, both from Box A and B perspectives, the 2 vertices are colliding at (1, 3, -1) and (1, 3, 1), but how come the bullet library says no contact point.
Any help is highly appreciable.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet does not detect collision of 2 boxes touching cor

Post by Erwin Coumans »

It depends on the algorithm used. For box-box, it uses an optimized SAT test with clipping, and the clipping code doesn't deal with this corner case. We could revisit the implementation to include the corner points, but there are much more serious issues elsewhere. It is possible to use GJK+EPA, and in that case, the contact will be detected (assuming 0 margin). But then, GJK/EPA has its own issues, and works best with some 'collision margin', so the boxes are rounded.
Post Reply