2D Collision Detection

Started by
0 comments, last by Wisconsin 21 years, 4 months ago
What is a good way to detect collision that happen in between updates? This happens when an objects velocity causes it to jump over an object during one time slice/update. I.E. At time T1 object A and B do not touch. At time T2 object A and B do not touch. But going from T1 to T2 causes object to go through object B.
Advertisement

instead of testing absolute positions like this

if (ax == bx)
velx = velx*-1;

you should do it this way

if (ax <=bx)
velx = valx*-1;

This topic is closed to new replies.

Advertisement