Jump to content
  • Advertisement

Archived

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

Wisconsin

2D Collision Detection

This topic is 5750 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!