Solving 2D Collision Detection Issues with Relative Velocities

Posted by Jengerer on Game Development See other posts from Game Development or by Jengerer
Published on 2012-06-12T19:24:40Z Indexed on 2012/06/12 22:49 UTC
Read the original article Hit count: 281

Filed under:

Imagine you have a situation where two objects are moving parallel to one-another and are both within range to collide with a static wall, like this:

The Problem

A common method used in dynamic collision detection is to loop through all objects in arbitrary order, solve for pair-wise collision detection using relative velocities, and then move the object to the nearest collision, if any.

However, in this case, if the red object is checked first against the blue one, it would see that the relative velocity to the blue object is -20 m/s (and would thereby not collide this time frame). Then it would see that the red object would collide with the static wall, and the solution would be:

The Solution

And the red object passes through the blue one. So it appears to be a matter of choosing the right order in which you check collisions; but how can you determine which order is correct? How can this passing through of objects be avoided? Is ignoring relative velocity and considering every object as static during pair-wise checks a better idea for this reason?

© Game Development or respective owner

Related posts about collision-detection