Collision detection with multiple contact points

Please don't post Bullet support questions here, use the above forums instead.
gfaraj
Posts: 3
Joined: Wed Mar 08, 2006 2:42 am

Collision detection with multiple contact points

Post by gfaraj »

Hi,
I'm having trouble implementing collision detection/response when two objects intersect in more than one point. Currently, for example, when checking if a box (oriented bounding box) collided with a scene face:

Code: Select all

if (box.intersects(face_plane))
{
    contact_point = face_plane.closest_point(box.position);

    if (face.contains_point(contact_point))
    {
         // we have a contact
    }
}
The problem with this is that I only get one contact point, even though the box might have been hitting multiple points on the face.

For example, http://66.253.147.225/images/physics.jpg
If I initialize the box in the shown pose, it stays in that pose, and doesn't rotate to fall correctly on the floor.

I'm using the contact handler I posted in:
http://continuousphysics.com/Bullet/php ... .php?t=257

Any help is appreciated. Thanks.