Jump to content
  • Advertisement
Sign in to follow this  
Zaph-0

Collision Math for 2d Objects

This topic is 3171 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

Hi, I am trying to find out when the path of 2 objects interesect (when they collide) which one to slow down and which one to speed up so that they don't overlap and came up with the following approach: For that I have to know which one of the objects is "ahead" of the other one. In my example the distance for the red object is greater than the blue object so the red one is ahead of the blue one. Problem is I am not certain if that still applies when the radius of one object is greater than the radius of the other one or if there is some fundamental flaw to my idea. I have no experience with this kind of stuff and this is just a wild guess but I hope this is the right approach to this situation. Does anyone have some experience with this ?

Share this post


Link to post
Share on other sites
Advertisement
This is known as a swept circle-circle collision. The basic idea is to take two parametric paths with respect to time and create an equation for when the paths are r1+r2 apart. Googling swept circle collision will probably get you what you want, if for each step your assuming your circles are moving in a line. If they are moving in more complicated paths it gets harder.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!