Skip to main content
gamedev.net
🔒 Locked

multiple collision : balls

Started by Agemaniac 1 reply 400+ views
Original Post
Agemaniac
Agemaniac
ok, imagine the following situation...the balls going to collide. ball 1 is in the position (20,0,0). ball 2 is in (-20,0,0) and ball 3 is in (0,0,0). if ball 1 and 2 is going to the origin velcity1 = (-10,0,0) and velocity2 = (10,0,0) how should i calculate the impulse? first compute the impulse of the the collision 1-3 and than calculate the impulse of the collision 2-3 and sum both??? if i do it i think that the ball 3 should stay in the (0,0,0) and the other two stop in the point of collison....... note: i''m assuming 3 identical balls...so a collision between two balls should change the velocities between then...if i handle the collision 1-3..the result should be velocity1 = (0,0,0)..velocity3(-10,0,0)..but i have to compute impulse from 2-3 to aply in 3 as well..ok..them in 2-3 velocity3 become (0,0,0) and velocity2 (0,0,0)..so i think it is wrong.........what i''m doing wrong?? can someone explain me or give some resources on the web when i can read about it? thanks...
Atheist
Atheist
a)
Correct solution (assuming a perfectly elastic collision):

before:
2 ------> 3 <------- 1

after hit:
<----- 2 3 1 ------>

in words: 1 and 2 bounce of (v1=(-v1x,0,0), v2=(-v2x,0,0)), 3 remains at rest in (0,0,0).

b) "impulse" is called momentum. Those people from old europe don´t seem to realize what´s going on in the world

c) momentum is calculated by p = m*v, where m is the mass of your sphere (but I don´t think that really was your question).

d) if both collisions (C1: 2->3, C2: 3<-1) take place the same time I think you can still calculate them as if they didn´t (at least you can do that as long as you have perfectly elastic colisions). Take C1 first: 2 transfers it´s momentum to 3. 2 is at rest, 3 moves towards 1. 3 hits 1, both of them bounce away, so v1 = (-v1x, 0, 0). 3 bounces back towards 2 which is at rest. They hit and 2 takes over the momentum from 3. Hence 3 is at rest and v2=(-v2x,0,0)...
This should also work if |v1x| <> |v2x| (balls 1 and 2 exchange their momentum,, then) but you might run into trouble when having unelastic collisions.
NOTE: This might not work with every way of detecting collisions (don´t know what the standard way of detecting collisions I just know how I´d do it).
Waverider
Waverider
I did my billiards demo the same way. Treat each collision separately. Handle the first one, then the next, etc.

My algorithm does have a problem with billiards that are absolutely flush against each other for some reason, but in theory, it should work.
It's not what you're taught, it's what you learn.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.