Original Post
I''m working on spherical object collision code and everything''s working great except one thing. I''m not sure if anyone can help but I''ll explain the problem and maybe someone has come across the same thing.
The only time it doesn''t correctly detect the collision is when the sphere is colliding with the edge of the polygon. For instance, a poly aligned down the x-axis, and the sphere is moving along so that it barely hits the top edge of the poly. About 70% of the time it collides correctly. Other times it just flies right through.
I''ve traced through the code (which I totally understand the math to it) and the Line / Sphere intersect code just doesn''t hit the sphere. I''m tracing a line from the closest point on the poly out in the opposite direction of the sphere''s velocity and it just doesn''t hit the sphere. Once I move the sphere to it''s new location (pos + velocity) it''s now embedded in the edge of the poly.
I can only guess that under special circumstances (slight angles maybe?) it''s just not precise. Anyway, I''m stumped as to what to try to fix this, or even figure out what the problem could be.
Has anyone run into anything like this? Maybe you have a suggestion that would help me figure it out.