Correct Ball Collision?


Quiest

I like turtles!
Joined
Sep 2, 2004
Messages
3,411
Age
40
Location
Dteuschland ;)
Okay, this is the situation.

I have a ball lying around, not moving.
And I want to shoot another ball at it (yeah, like billiard :D) and when the moving ball hits, it should stop, give the other ball its speed and the correct angle for the direction.

How to do this? Speed and stuff is no problem, just the calculation of the angle for the balls.

Help me, please!
 
You should use vectors: your first ball will stop only if its speed vector intersects the center of the second ball, otherwise the speed will only decrease and the direction will change.
You must consider the angle between the speed vector of the first ball and the segment connecting the two balls (in the exact instant when the first collides with the second).
Then you should consider the weight of the two balls, but if it is the same it is easier :)
 
Ok, after trying to put it into words for a good 10 minutes and then realising my English vocabulary doesn't hold when it comes to physics pseudo code explanations, I'll try to just smack it into an example. Hope you can make something out of it then. Just a moment.

EDIT. Ok, so it mostly works, and I'm going to bed. It's not very informative, so I think you're better off trying Google or Oankali's link for (probably better) documentation on the subject anyway. Good luck, maybe I'll finish it tomorrow, we'll see I guess.
 
Thanks! I`m really waiting for your example, Moogle.
The "weight" of the two objects arethe same (its gonna be some kind of curling game).

Oankalis link was informative and interesting but it didn`t really help me.
Well, I`m going to take a closer look now!.
 
Back
Top