[ODE] Boxiangle collision

Ruud van Gaal ruud at marketgraph.nl
Thu May 2 14:39:02 2002


Hi all,

I have some trouble with colliding a box and a triangle.
I have a car with a bounding box (OBB) which can hit polygons on the track.
The track consists of all triangles, but since a dBoxTriangle (or
dCollideBT) is missing, I'm generating contact points using the plane of the
triangle and using dCollideBP() (Box vs. Plane).

Problem is that if you hit a barrier straight on, the plane is infinite and
dCollideBP() thinks the box is way inside the plane, giving explosive
constraint forces:

  |  | barrier
  |  |
  ----/\
     /  \
     \  /  <=car box
      \/

Above, you can see that as the car softly hits the barrier triangle, the
barrier plane actually extends deep into the box, giving big penetration
depths.

Does anybody have a box vs. triangle collisions function, or some idea how
to tackle this? Driving against a barrier now is just scary. ;-)

Thanks,
Ruud