locked
Collision RRS feed

  • Question

  • I've created a few bounding spheres thanks to some of the kind folks on this forum . I've now got to implement some basic physics for ball to ball collision. (for a snooker style idea) any ideas how I would do this?

    Thanks,

     

    Friday, January 26, 2007 1:08 PM

Answers

  • In this case, bounding boxes will not be good.
    Try spheres instead. Just a point + radius check. Spheres are also faster.
    Friday, January 26, 2007 5:13 PM

All replies

  • In this case, bounding boxes will not be good.
    Try spheres instead. Just a point + radius check. Spheres are also faster.
    Friday, January 26, 2007 5:13 PM
  • I have used bounding spheres, but i have no idea what to put in the intersect method to make a basic collision take place (like calculating the angles at which the balls will move off from each other and the speed etc.)
    Friday, January 26, 2007 6:49 PM
  • He said he was using spheres... anyways since no one has answered maybe I can point you in the right direction. Pretty much when an Intersect() between the 2 objects happens you take the speed and angle of each and do stuff with them. If a ball hits a wall on the pool table head on its going to lose a bit of speed and reverse direction. If it hits at an angle its going to bounce off in the other direction and lose a little bit of speed. You just do some math on the X and Y to achieve this effect. Maybe if you draw it out on paper or go play a game of pool you can visualize how the X and Y's change when things hit other things. If you are allowing for english in your pool game then when a ball hits another ball (cue ball on target ball), you would stop the cue ball and send the target ball in the same direction as the cue ball (if the cue ball hits to the side of the other ball then angle it some) and if the cue ball had no english stop the cue ball. If you put top spin on the cue ball, make the cue ball keep rolling and so on. I know this isn't going to help programmatically, but if you think of the pool table as an X,Y plane then you can visualize these things happening. Hope I helped!

    EDIT:  Posted this before seeing Matt's last message. :-/
    Friday, January 26, 2007 6:52 PM
  • Hi
     
    Jeff Lander wrote a nice article on physics and pool games which might help out.  THe link is here...
     
     
    You'll need to register though.  Good Luck!
     
    Scott
     
    Friday, January 26, 2007 11:03 PM
  • I haven't read Jeff Lander's article yet, but have just implemented some swept sphere intersections tests (sphere-sphere and sphere-plane).  One of the references I used was (also on Gamasutrua):

    Miguel Gomez, Simple Intersection Tests For Games, 19991018

    http://www.gamasutra.com/features/19991018/Gomez_1.htm

     

    Saturday, January 27, 2007 12:29 AM