|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.math.Plane
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.
| Field Summary | |
float |
constant
Constant of the plane. |
static int |
NEGATIVE_SIDE
NEGATIVE_SIDE represents a point on the opposite side the normal points. |
static int |
NO_SIDE
NO_SIDE represents the plane itself. |
Vector3f |
normal
Vector normal to the plane. |
static int |
POSITIVE_SIDE
POSITIVE_SIDE represents a point on the side the normal points. |
| Constructor Summary | |
Plane()
Constructor instantiates a new Plane object. |
|
Plane(Vector3f normal,
float constant)
Constructor instantiates a new Plane object. |
|
| Method Summary | |
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. |
void |
setConstant(float constant)
setConstant sets the constant value that helps define the
plane. |
void |
setNormal(Vector3f normal)
setNormal sets the normal of the plane. |
java.lang.String |
toString()
toString returns a string thta represents the string
representation of this plane. |
int |
whichSide(Vector3f point)
whichSide returns the side at which a point lies on
the plane. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NO_SIDE
public static final int POSITIVE_SIDE
public static final int NEGATIVE_SIDE
public Vector3f normal
public float constant
| Constructor Detail |
public Plane()
Plane object. This is the
default object and contains a normal of (0,0,0) and a constant of 0.
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.| Method Detail |
public void setNormal(Vector3f normal)
setNormal sets the normal of the plane.
normal - the new normal of the plane.public Vector3f getNormal()
getNormal retrieves the normal of the plane.
public void setConstant(float constant)
setConstant sets the constant value that helps define the
plane.
constant - the new constant value.public float getConstant()
getConstant returns the constant of the plane.
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 int whichSide(Vector3f point)
whichSide returns the side at which a point lies on
the plane. The positive values returned are: NEGATIVE_SIDE, POSITIVE_SIDE
and NO_SIDE.
point - the point to check.
public java.lang.String toString()
toString returns a string thta represents the string
representation of this plane. It represents the normal as a
Vector3f object, so the format is the following:
com.jme.math.Plane [Normal: org.jme.math.Vector3f [X=XX.XXXX, Y=YY.YYYY,
Z=ZZ.ZZZZ] - Constant: CC.CCCCC]
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||