[ODE] Tips on collision detection

Matthias Baas baas at ira.uka.de
Fri Sep 5 06:22:02 2003


At 16:31 28.08.2003 -0500, Nolan J. Darilek wrote:
>I currently have collision detection code that sends a
>per-object-customizable message into the environment. I've arbitrarily
>chosen a penetration depth of 0.1, and any collisions of depths less
>than that result in no message being sent. Messages are sent by
>collide and collide_with methods which, eventually, will be overridden
>to actually cause damage.
>[...]
>Am I even remotely on the right track with this idea? Can anyone else
>offer perspectives on how to map collision penetration depths into
>actual game terms, determining the non-physics game effects of a
>particular impact?

I think it would be better to use the impulses (mass * velocity) of the 
colliding objects. The higher the relative impulse (in normal direction), 
the more severe the damage.

I guess using the penetration depth isn't very reliable. A particular 
penetration depth doesn't actually tell you anything about how severe the 
impact has been. It depends on where the colliding object (in your case, 
the car) was located in the previous frame. Was it just right before the 
wall, almost touching it or was it far away? In both cases you could have 
the same penetration depth but the result in your game should be quite 
different.

- Matthias -