Plane implements Cloneable, Savable, Externalizable, ReadOnlyPlane, Poolable { @Override public Vector3 reflectVector(final ReadOnlyVector3 unitVector, final Vector3 store) { Vector3 result = store; if (result == null) { result = new Vector3(); } final double dotProd = _normal.dot(unitVector) * 2; result.set(unitVector).subtractLocal(_normal.getX() * dotProd, _normal.getY() * dotProd, _normal.getZ() * dotProd); return result; } Plane();  Plane(final ReadOnlyPlane source);  Plane(final ReadOnlyVector3 normal, final double constant); @Override double getConstant(); @Override ReadOnlyVector3 getNormal(); Plane set(final ReadOnlyPlane source); void setConstant(final double constant); void setNormal(final ReadOnlyVector3 normal); @Override double pseudoDistance(final ReadOnlyVector3 point); @Override Side whichSide(final ReadOnlyVector3 point); Plane setPlanePoints(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB,
      final ReadOnlyVector3 pointC); @Override Vector3 reflectVector(final ReadOnlyVector3 unitVector, final Vector3 store); static boolean isValid(final ReadOnlyPlane plane); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object o); @Override Plane clone(); @Override Class<? extends Plane> getClassTag(); @Override void write(final OutputCapsule capsule); @Override void read(final InputCapsule capsule); @Override void readExternal(final ObjectInput in); @Override void writeExternal(final ObjectOutput out); final static Plane fetchTempInstance(); final static void releaseTempInstance(final Plane plane); static final ReadOnlyPlane XZ; static final ReadOnlyPlane XY; static final ReadOnlyPlane YZ; }
@Test public void testReflect() { final Plane plane1 = new Plane(Vector3.UNIT_X, 5.0); assertEquals(new Vector3(), plane1.reflectVector(new Vector3(), new Vector3())); assertEquals(new Vector3(-1, 0, 0), plane1.reflectVector(new Vector3(1, 0, 0), null)); assertEquals(new Vector3(-1, 1, 1).normalizeLocal(), plane1.reflectVector(new Vector3(1, 1, 1).normalizeLocal(), null)); assertEquals(new Vector3(-3, 2, -1).normalizeLocal(), plane1.reflectVector(new Vector3(3, 2, -1).normalizeLocal(), null)); final Plane plane2 = new Plane(Vector3.UNIT_Z, 1.0); assertEquals(new Vector3(), plane2.reflectVector(new Vector3(), new Vector3())); assertEquals(new Vector3(0, 0, -1), plane2.reflectVector(new Vector3(0, 0, 1), null)); assertEquals(new Vector3(1, 1, -1).normalizeLocal(), plane2.reflectVector(new Vector3(1, 1, 1).normalizeLocal(), null)); assertEquals(new Vector3(3, 2, 1).normalizeLocal(), plane2.reflectVector(new Vector3(3, 2, -1).normalizeLocal(), null)); }