Jump to content
  • Advertisement
Sign in to follow this  
kylecrass

Collision Detection using angles

This topic is 4763 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 was wondering if it is possible to determine if two objects have the "chance" to collide, based upon their given projections and speed. For example if object a is moving at 23 degrees at 5 mph, and object b is moving 45 degrees at 7 mph, will they collide eventually? And if so, at what point? Any help would be much appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Sure it's possible. Since you mention a single angle I'm assuming 2d? And by 'projection' to you mean position?

Another factor is what shape you are using to represent the objects - circle, box, polytope, etc. For most basic shapes, there are standard algorithms for doing what you want to do.

Share this post


Link to post
Share on other sites
Shape plays a big factor as jyk said. Also, if you convert your angles to velocity vectors, with lengths equal to their speeds, you can speed up you calculations tremendously.

Generally, you calculate the relative direction of object A heading towards object B and then determine at what time A will hit B. There are also plenty of short tests you can perform to break out of the collision detection early if the objects have no chance of colliding.

Will this help?

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!