|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.math.Plane
public class Plane
A plane in 3D space.
The plane is defined by a vector, N which is normal to the plane; and a constant, C, representing the distance of the plane from the origin. The plane can be represented by the equation C = Nâp where p
is a point on the plane.
Nested Class Summary | |
---|---|
static class |
Plane.Side
|
Field Summary | |
---|---|
float |
constant
Constant of the plane. |
Vector3f |
normal
Vector normal to the plane. |
Constructor Summary | |
---|---|
Plane()
Constructor instantiates a new Plane object. |
|
Plane(Vector3f normal,
float constant)
Constructor instantiates a new Plane object. |
Method Summary | |
---|---|
Plane |
clone()
|
java.lang.Class<? extends Plane> |
getClassTag()
|
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 |
read(JMEImporter e)
|
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. |
void |
setPlanePoints(Triangle t)
Initialize this plane using the three points of the given triangle. |
void |
setPlanePoints(Vector3f v1,
Vector3f v2,
Vector3f v3)
Initialize the Plane using the given 3 points as coplanar. |
java.lang.String |
toString()
toString returns a string thta represents the string
representation of this plane. |
Plane.Side |
whichSide(Vector3f p)
Determine on which side of this plane the point p lies. |
void |
write(JMEExporter e)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 Plane.Side whichSide(Vector3f p)
p
lies.
p
- the point to check.
public void setPlanePoints(Triangle t)
t
- the trianglepublic void setPlanePoints(Vector3f v1, Vector3f v2, Vector3f v3)
v1
- the first pointv2
- the second pointv3
- the third pointpublic 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]
toString
in class java.lang.Object
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
java.io.IOException
public java.lang.Class<? extends Plane> getClassTag()
getClassTag
in interface Savable
public Plane clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |