Frustum { public Frustum setToUnitFrustum() { this.left.set(1, 0, 0, 1); this.right.set(-1, 0, 0, 1); this.bottom.set(0, 1, 0, 1); this.top.set(0, -1, 0, 1); this.near.set(0, 0, -1, 1); this.far.set(0, 0, 1, 1); this.viewport.set(0, 0, 1, 1); return this; } 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 testSetToUnitFrustum() throws Exception { Plane left = new Plane(0, 1, 0, 2); Plane right = new Plane(0, -1, 0, 2); Plane bottom = new Plane(0, 0, 1, 2); Plane top = new Plane(0, 0, -1, 2); Plane near = new Plane(1, 0, 0, 0); Plane far = new Plane(-1, 0, 0, 1.5); Viewport viewport = new Viewport(1, 2, 3, 4); Frustum frustum = new Frustum(left, right, bottom, top, near, far, viewport); frustum.setToUnitFrustum(); assertEquals("left", new Plane(1, 0, 0, 1), frustum.left); assertEquals("right", new Plane(-1, 0, 0, 1), frustum.right); assertEquals("bottom", new Plane(0, 1, 0, 1), frustum.bottom); assertEquals("top", new Plane(0, -1, 0, 1), frustum.top); assertEquals("near", new Plane(0, 0, -1, 1), frustum.near); assertEquals("far", new Plane(0, 0, 1, 1), frustum.far); assertEquals("viewport", new Viewport(0, 0, 1, 1), frustum.viewport); }