Sign in to follow this  
kylecrass

Collision Detection using angles

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this