public class Plane
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Plane defines a plane where Normal dot (x,y,z) = Constant.
This provides methods for calculating a "distance" of a point from this
plane. The distance is pseudo due to the fact that it can be negative if the
point is on the non-normal side of the plane.| Modifier and Type | Field and Description |
|---|---|
protected float |
constant
Constant of the plane.
|
protected Vector3f |
normal
Vector normal to the plane.
|
| Constructor and Description |
|---|
Plane(Vector3f normal,
float constant)
Constructor instantiates a new
Plane object. |
Plane(Vector3f normal,
Vector3f displacement)
Constructor instantiates a new
Plane object. |
| Modifier and Type | Method and Description |
|---|---|
Plane |
clone()
Create a copy of this plane.
|
Vector3f |
getClosestPoint(Vector3f point,
Vector3f store)
Find the point in this plane that's nearest to the specified point.
|
float |
getConstant()
getConstant returns the constant of the plane. |
Vector3f |
getNormal()
getNormal retrieves the normal of the plane. |
float |
pseudoDistance(Vector3f point)
pseudoDistance calculates the distance from this plane to
a provided point. |
java.lang.String |
toString()
toString returns a string representation of this plane. |
protected Vector3f normal
protected float constant
public Plane(Vector3f normal, float constant)
Plane object. The normal
and constant values are set at creation.normal - the normal of the plane.constant - the constant of the plane.public Vector3f getNormal()
getNormal retrieves the normal of the plane.public float getConstant()
getConstant returns the constant of the plane.public Vector3f getClosestPoint(Vector3f point, Vector3f store)
point - the location of the input point (not null, unaffected)store - storage for the result (not null, modified)public float pseudoDistance(Vector3f point)
pseudoDistance calculates the distance from this plane to
a provided point. If the point is on the negative side of the plane the
distance returned is negative, otherwise it is positive. If the point is
on the plane, it is zero.point - the point to check.public java.lang.String toString()
toString returns a string representation of this plane.
It represents the normal as a Vector3f, so the format is:
Plane [Normal: (X.XXXX, Y.YYYY, Z.ZZZZ) - Constant: C.CCCC]toString in class java.lang.Objectpublic Plane clone()
clone in class java.lang.Object