# Collision Detection

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

## Recommended Posts

Hey all, I'm looking for ideas on how to do a collision detection manager. You see, I have to develop a pool game. Now, for a simple game like pong the collisions are easy enough - because u really only have to check collision for 1 object. But with pool I obviously have a number of balls I need to keep track of. I expect I'll need a way to detect all of the collisions before I move the balls... I'm just not sure exactly how to do this. So if anyone knows a good method for this sort of collision detection let me know! Thanks! Ryan

##### Share on other sites
most collision detection algorithms work like this.

Find colliding pairs of objects,
calculate resulting force
repeat for all objects in the scene,
update position of all objects
render

##### Share on other sites
I'm making a pongish breakoutish type of game with multiple balls and use a similar approach. Here is a good resource on ball collision.

Another issue to keep in mind is when the order they collide in. If both balls B and C collide with ball A, you need to figure out which one hit first (let's say it was B), calculate the vector that C would be on after that point in time (same vector but the position is updated and the length of the vector will be smaller), and recalculate to see if there is still a collision between A and C, going from there. Etc. There are quite a few nuances involved with physics and dynamic collision detection which is why there are so many libraries to handle these things now-a-days. Have fun!

Cheers
-Scott

1. 1
2. 2
frob
20
3. 3
Rutin
17
4. 4
5. 5

• 13
• 10
• 9
• 18
• 9
• ### Forum Statistics

• Total Topics
632555
• Total Posts
3007035

×