# Collision Detection using angles

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

## 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 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 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 on other sites
Thanks alot! That article by gamasutra is very helpful! :D

1. 1
2. 2
Rutin
25
3. 3
4. 4
5. 5

• 10
• 13
• 19
• 14
• 9
• ### Forum Statistics

• Total Topics
632942
• Total Posts
3009340
• ### Who's Online (See full list)

There are no registered users currently online

×