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:
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:
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?