View Single Post
Old 2008-01-24, 14:19   #4
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

5×11×107 Posts
Default

Quote:
Originally Posted by kuratkull View Post
Umm, if you look at the code in my first post, you see that I'm using doubles.
sorry, I didn't think to actually read your code

Now that I see what you are doing, I can see why you have such a problem. You are iterating through your ray at small increments! Wow, I have never seen that approach before. In that case I strongly suggest you find the line/plane intersection formula. Google for it or even better, write down the two equations for a line and a plane an equate the two together. Then solve for x and y and that is you intersection point. With suitable bounds checking of x and y you can detect arbitrary collision of any shape you chose to define that lies on the plane.
retina is online now   Reply With Quote