com.jme3.math
クラス Plane

java.lang.Object
  上位を拡張 com.jme3.math.Plane
すべての実装されたインタフェース:
Savable, java.io.Serializable, java.lang.Cloneable

public class Plane
extends java.lang.Object
implements Savable, 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.

関連項目:
直列化された形式

入れ子のクラスの概要
static class Plane.Side
           
 
コンストラクタの概要
Plane()
          Constructor instantiates a new Plane object.
Plane(Vector3f normal, float constant)
          Constructor instantiates a new Plane object.
 
メソッドの概要
 Plane clone()
           
 Vector3f getClosestPoint(Vector3f point)
           
 Vector3f getClosestPoint(Vector3f point, Vector3f store)
           
 float getConstant()
          getConstant returns the constant of the plane.
 Vector3f getNormal()
          getNormal retrieves the normal of the plane.
 boolean isOnPlane(Vector3f point)
           
 float pseudoDistance(Vector3f point)
          pseudoDistance calculates the distance from this plane to a provided point.
 void read(JmeImporter e)
           
 Vector3f reflect(Vector3f point, Vector3f store)
           
 void setConstant(float constant)
          setConstant sets the constant value that helps define the plane.
 void setNormal(float x, float y, float z)
          setNormal sets the normal of the plane.
 void setNormal(Vector3f normal)
          setNormal sets the normal of the plane.
 void setOriginNormal(Vector3f origin, Vector3f normal)
          Initialize this plane using a point of origin and a normal.
 void setPlanePoints(AbstractTriangle 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 point)
          whichSide returns the side at which a point lies on the plane.
 void write(JmeExporter e)
           
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

Plane

public Plane()
Constructor instantiates a new Plane object. This is the default object and contains a normal of (0,0,0) and a constant of 0.


Plane

public Plane(Vector3f normal,
             float constant)
Constructor instantiates a new Plane object. The normal and constant values are set at creation.

パラメータ:
normal - the normal of the plane.
constant - the constant of the plane.
メソッドの詳細

setNormal

public void setNormal(Vector3f normal)
setNormal sets the normal of the plane.

パラメータ:
normal - the new normal of the plane.

setNormal

public void setNormal(float x,
                      float y,
                      float z)
setNormal sets the normal of the plane.


getNormal

public Vector3f getNormal()
getNormal retrieves the normal of the plane.

戻り値:
the normal of the plane.

setConstant

public void setConstant(float constant)
setConstant sets the constant value that helps define the plane.

パラメータ:
constant - the new constant value.

getConstant

public float getConstant()
getConstant returns the constant of the plane.

戻り値:
the constant of the plane.

getClosestPoint

public Vector3f getClosestPoint(Vector3f point,
                                Vector3f store)

getClosestPoint

public Vector3f getClosestPoint(Vector3f point)

reflect

public Vector3f reflect(Vector3f point,
                        Vector3f store)

pseudoDistance

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.
戻り値:
the signed distance from the plane to a point.

whichSide

public Plane.Side 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.
戻り値:
the side at which the point lies.

isOnPlane

public boolean isOnPlane(Vector3f point)

setPlanePoints

public void setPlanePoints(AbstractTriangle t)
Initialize this plane using the three points of the given triangle.

パラメータ:
t - the triangle

setOriginNormal

public void setOriginNormal(Vector3f origin,
                            Vector3f normal)
Initialize this plane using a point of origin and a normal.

パラメータ:
origin -
normal -

setPlanePoints

public void setPlanePoints(Vector3f v1,
                           Vector3f v2,
                           Vector3f v3)
Initialize the Plane using the given 3 points as coplanar.

パラメータ:
v1 - the first point
v2 - the second point
v3 - the third point

toString

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]

オーバーライド:
クラス java.lang.Object 内の toString
戻り値:
the string representation of this plane.

write

public void write(JmeExporter e)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
例外:
java.io.IOException

read

public void read(JmeImporter e)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
例外:
java.io.IOException

clone

public Plane clone()
オーバーライド:
クラス java.lang.Object 内の clone