Skip to content
Snippets Groups Projects
Commit 0913dc7e authored by David Blyth's avatar David Blyth
Browse files

Modified AbstractPolyhedron to quit looping over surfaces to check if point is...

Modified AbstractPolyhedron to quit looping over surfaces to check if point is inside as soon as it finds that point is outside
parent fad64ec2
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,8 @@ public abstract class AbstractPolyhedron extends AbstractSolid implements IPolyh
for (Polygon3D face : getFaces())
{
if (GeomOp3D.intersects(point,face)) return Inside.SURFACE;
inside = inside && (GeomOp3D.distanceBetween(point,face.getPlane()) < 0);
if (!(inside = inside && GeomOp3D.distanceBetween(point,face.getPlane()) < 0))
break;
}
if (inside) return Inside.INSIDE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment