Frustum { public boolean containsPoint(Vec3 point) { if (point == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "Frustum", "containsPoint", "missingPoint")); } if (this.far.dot(point) <= 0) return false; if (this.left.dot(point) <= 0) return false; if (this.right.dot(point) <= 0) return false; if (this.top.dot(point) <= 0) return false; if (this.bottom.dot(point) <= 0) return false; if (this.near.dot(point) <= 0) return false; return true; } Frustum();  Frustum(Plane left, Plane right, Plane bottom, Plane top, Plane near, Plane far, Viewport viewport); Frustum setToUnitFrustum(); Frustum setToModelviewProjection(Matrix4 projection, Matrix4 modelview, Viewport viewport); Frustum setToModelviewProjection(Matrix4 projection, Matrix4 modelview, Viewport viewport, Viewport subViewport); boolean containsPoint(Vec3 point); boolean intersectsSegment(Vec3 pointA, Vec3 pointB); boolean intersectsViewport(Viewport viewport);  }
@Test public void testContainsPoint() throws Exception { Frustum frustum = new Frustum(); assertTrue("origin", frustum.containsPoint(new Vec3(0, 0, 0))); assertTrue("inside near", frustum.containsPoint(new Vec3(0, 0, -0.999999))); assertTrue("inside far", frustum.containsPoint(new Vec3(0, 0, 0.999999))); assertTrue("inside left", frustum.containsPoint(new Vec3(0.9999999, 0, 0))); assertTrue("inside right", frustum.containsPoint(new Vec3(-0.9999999, 0, 0))); assertTrue("inside bottom", frustum.containsPoint(new Vec3(0, -0.9999999, 0))); assertTrue("inside top", frustum.containsPoint(new Vec3(0, 0.9999999, 0))); assertFalse("outside left", frustum.containsPoint(new Vec3(1.0000001, 0, 0))); assertFalse("outside right", frustum.containsPoint(new Vec3(-1.0000001, 0, 0))); assertFalse("outside bottom", frustum.containsPoint(new Vec3(0, -1.0000001, 0))); assertFalse("outside top", frustum.containsPoint(new Vec3(0, 1.0000001, 0))); assertFalse("outside near", frustum.containsPoint(new Vec3(0, 0, -1.0000001))); assertFalse("outside far", frustum.containsPoint(new Vec3(0, 0, 1.0000001))); assertFalse("on left side", frustum.containsPoint(new Vec3(1, 0, 0))); assertFalse("on bottom side", frustum.containsPoint(new Vec3(0, -1, 0))); assertFalse("on top side", frustum.containsPoint(new Vec3(0, 1, 0))); assertFalse("on right side", frustum.containsPoint(new Vec3(-1, 0, 0))); assertFalse("on near", frustum.containsPoint(new Vec3(0, 0, -1))); assertFalse("on far", frustum.containsPoint(new Vec3(0, 0, 1))); }