Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Wisconsin

2D Collision Detection

This topic is 5662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!