0

Hiho. On a below image we have three situations. Black arrow shows the path before collision, green one - after the collision.

I. Ball 1 hits ball 2 when their are floating on themselves. After the collision, they should both reverse their directions from up to down and from down to up.

II. Ball 1 hits ball 2 and ball 1 reverses it's direction, ball 2 still floats to it's old dir.

III. Here we have a problem. Ball one has lower x position, they collide with just a piece and they should float to some direction that I don't know.

enter image description here I know some vectors, linear algebra etc. but I just need a point where to start. Is there anyone who know how to solve an issue like this? With vectors? Trig/Cycl functions?

Thanks !

  • I have just simple reversing - when ball 1 collides with ball 2, they just change their vectors from x to -x and y to -y. I know how to do the second one but it's a stupid way at all. –  Sep 09 '15 at 10:56
  • Here is a similar question: http://stackoverflow.com/questions/345838/ball-to-ball-collision-detection-and-handling – Chmiel123 Sep 09 '15 at 11:01
  • Maybe you should have a look at https://en.wikipedia.org/wiki/Elastic_collision – PKuhn Sep 09 '15 at 11:11
  • That's the name of it! Thank you very much guys! –  Sep 09 '15 at 11:35

0 Answers0