Package com.jme3.math
Class Plane
java.lang.Object
com.jme3.math.Plane
- All Implemented Interfaces:
Serializable,Cloneable
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.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Create a copy of this plane.getClosestPoint(Vector3f point, Vector3f store) Find the point in this plane that's nearest to the specified point.floatgetConstantreturns the constant of the plane.getNormalretrieves the normal of the plane.floatpseudoDistance(Vector3f point) pseudoDistancecalculates the distance from this plane to a provided point.toString()toStringreturns a string representation of this plane.
-
Field Details
-
normal
Vector normal to the plane. -
constant
protected float constantConstant of the plane. See formula in class definition.
-
-
Constructor Details
-
Plane
Constructor instantiates a newPlaneobject. The normal and constant values are set at creation.- Parameters:
normal- the normal of the plane.constant- the constant of the plane.
-
Plane
Constructor instantiates a newPlaneobject.- Parameters:
normal- The normal of the plane.displacement- A vector representing a point on the plane.
-
-
Method Details
-
getNormal
getNormalretrieves the normal of the plane.- Returns:
- the normal of the plane.
-
getConstant
public float getConstant()getConstantreturns the constant of the plane.- Returns:
- the constant of the plane.
-
getClosestPoint
Find the point in this plane that's nearest to the specified point.- Parameters:
point- the location of the input point (not null, unaffected)store- storage for the result (not null, modified)- Returns:
- the location of the nearest point (store)
-
pseudoDistance
pseudoDistancecalculates 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.- Parameters:
point- the point to check.- Returns:
- the signed distance from the plane to a point.
-
toString
toStringreturns a string representation of this plane. It represents the normal as aVector3f, so the format is: Plane [Normal: (X.XXXX, Y.YYYY, Z.ZZZZ) - Constant: C.CCCC] -
clone
Create a copy of this plane.
-