Collision detection

Started by
1 comment, last by cmwslw 16 years, 11 months ago
I am making a physics simulation that has a ball bouncing around the screen with several lines that serve as obstacles. I am using iterative methods for gravity etc., and I want to detect if the ball has collided with a line. What makes this even harder is that the ball is 32x32 with its center being at 16,16. This means that there is a 16 pixel offset in every direction. I'm guessing you would use line and circle collision detection. I'd like to detect the collision as fast as possible. Can anyone point me in the right direction as to what method I should use? -Cory Walker [Edited by - cmwslw on May 7, 2007 7:18:52 PM]
Advertisement
Quote:I'm guessing you would use line and circle collision detection.

Yep.
http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/
I have one question though: What does the variable 'u' stand for? It doesn't mention anything about 'u'.
EDIT: Nevermind, I figured it out. You are supposed to solve for u at the end.

This topic is closed to new replies.

Advertisement