Reducing plane checks
Iam working on some collision detection algorithms, and my current state is working on optimizing polygon collision. I have it that currently it takes 1 + N planes to solve, where 1 is the face plane, and N are the planes which are orthogonal to the edges of the polygon, in other words, N is the number of edges of the polygon. What I am doing, is checking to see if the object has intersected or is behind the face plane, then checking to see if it is in front of all of the orthogonal planes,if they are, the object has collided with the polygon. Is there anyway to optimize this while not getting any false positives, or atleast only a small chance of false positives( <5%)?
if the object is totally outside an edge plane, then there is no need to test with the other edge planes. that should happen in most cases, except for triangles close to the object, so it cuts down nicely on the number of checks. furthermore, with the triangle plane, you should check the edge planes only if the object crosses the main traingle plane. Else, it''s either totally below or above the triangle, so no need for further tests.
additionaly, if you can compute and store the interval of the triangle along each edge planes (take the opposite vertex to the edge, and one vertex on the edge), and if the box/object''s interval does not cross that interval, then no need to test other edges.
as Fantasio says, a separation algorithm-based box/tri test does just that. Depending what kind of objects you use, you might want to look into it.
additionaly, if you can compute and store the interval of the triangle along each edge planes (take the opposite vertex to the edge, and one vertex on the edge), and if the box/object''s interval does not cross that interval, then no need to test other edges.
as Fantasio says, a separation algorithm-based box/tri test does just that. Depending what kind of objects you use, you might want to look into it.
when you calculate the time it intersects the face plane only check the polygon if the fraction it intersects the face plane is less than the closest valid fraction you''ve already found.
which brings up a new question, I am currently having it that if they point is close enough to the plane or is behind it , it is a collision; however, I know this will give alot of false positives and was wondering what threads/articles you know of that ACCURATELY describe how to deal with objects that are moving so fast that they might jump entirely over a bounding box during the time between two frames.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement