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
-
Constructor Summary
-
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.float
getConstant
returns the constant of the plane.getNormal
retrieves the normal of the plane.float
pseudoDistance
(Vector3f point) pseudoDistance
calculates the distance from this plane to a provided point.toString()
toString
returns 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 newPlane
object. 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 newPlane
object.- Parameters:
normal
- The normal of the plane.displacement
- A vector representing a point on the plane.
-
-
Method Details
-
getNormal
getNormal
retrieves the normal of the plane.- Returns:
- the normal of the plane.
-
getConstant
public float getConstant()getConstant
returns 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
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.- Parameters:
point
- the point to check.- Returns:
- the signed distance from the plane to a point.
-
toString
toString
returns 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.
-