PDA

View Full Version : Collision Precision



HemiMG
11-03-2001, 05:46 PM
Hey that kinda rhymed. http://www.opengl.org/discussion_boards/ubb/smile.gif
Anyhow I have implemented collision detection and have hit a stumbling block. I have the collision with the plane, the I calculate the exact point of the collision. Next is to find if the point is within the polygon. The method I choose to use was the one where you add the angles of the polygon in relation to the point (or something like that) and are supposed to get 2pi if there is a collison.
The problem is if I compare the result with 2pi exactly I don't collide with anything. If it give it a little leeway for variable precision I collide with things that aren't there.
Exactly how much leeway should I give the thing, and will that number be standard across different computers?
If there is a more simple way to go about this please tell me. I read the one about making planes out of every side in the poly and checking that way, but that seems like a lot of overhead having to calculate a plane for each side and then calculating a normal for it, etc etc.