Plane implements Serializable { public boolean isFrontFacing(Vector3 direction) { float dot = normal.dot(direction); return dot <= 0; } Plane();  Plane(Vector3 normal, float d);  Plane(Vector3 normal, Vector3 point);  Plane(Vector3 point1, Vector3 point2, Vector3 point3); void set(Vector3 point1, Vector3 point2, Vector3 point3); void set(float nx, float ny, float nz, float d); float distance(Vector3 point); PlaneSide testPoint(Vector3 point); PlaneSide testPoint(float x, float y, float z); boolean isFrontFacing(Vector3 direction); Vector3 getNormal(); float getD(); void set(Vector3 point, Vector3 normal); void set(float pointX, float pointY, float pointZ, float norX, float norY, float norZ); void set(Plane plane); String toString(); final Vector3 normal; public float d; }
@Test public void testFrontFacing() { final Plane plane = new Plane(new Vector3(0.0f, 0.1f, 0.2f), 0.3f); Assert.assertEquals(false, plane.isFrontFacing(new Vector3(0.4f, 0.5f, 0.6f))); Assert.assertEquals(true, plane.isFrontFacing(new Vector3(0.0f, 0.0f, 0.0f))); }