com.jme3.math
クラス Spline

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

public class Spline
extends java.lang.Object
implements Savable


入れ子のクラスの概要
static class Spline.SplineType
           
 
コンストラクタの概要
Spline()
           
Spline(java.util.List<Vector4f> controlPoints, java.util.List<java.lang.Float> nurbKnots)
          Create a NURBS spline.
Spline(Spline.SplineType splineType, java.util.List<Vector3f> controlPoints, float curveTension, boolean cycle)
          Create a spline
Spline(Spline.SplineType splineType, Vector3f[] controlPoints, float curveTension, boolean cycle)
          Create a spline
 
メソッドの概要
 void addControlPoint(Vector3f controlPoint)
          Adds a controlPoint to the spline
 int getBasisFunctionDegree()
          This method returns NURBS' spline basis function degree.
 java.util.List<Vector3f> getControlPoints()
          returns this spline control points
 float getCurveTension()
          returns the curve tension
 java.util.List<java.lang.Float> getKnots()
          This method returns NURBS' spline knots.
 float getMaxNurbKnot()
          This method returns the maximum nurb curve knot value.
 float getMinNurbKnot()
          This method returns the minimum nurb curve knot value.
 java.util.List<java.lang.Float> getSegmentsLength()
          returns a list of float representing the segments lenght
 float getTotalLength()
          return the total lenght of the spline
 Spline.SplineType getType()
          return the type of the spline
 float[] getWeights()
          This method returns NURBS' spline weights.
 Vector3f interpolate(float value, int currentControlPoint, Vector3f store)
          Iterpolate a position on the spline
 boolean isCycle()
          returns true if the spline cycle
 void read(JmeImporter im)
           
 void removeControlPoint(Vector3f controlPoint)
          remove the controlPoint from the spline
 void setCurveTension(float curveTension)
          sets the curve tension
 void setCycle(boolean cycle)
          set to true to make the spline cycle
 void setType(Spline.SplineType type)
          Sets the type of the spline
 void write(JmeExporter ex)
           
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Spline

public Spline()

Spline

public Spline(Spline.SplineType splineType,
              Vector3f[] controlPoints,
              float curveTension,
              boolean cycle)
Create a spline

パラメータ:
splineType - the type of the spline @see {SplineType}
controlPoints - an array of vector to use as control points of the spline If the type of the curve is Bezier curve the control points should be provided in the appropriate way. Each point 'p' describing control position in the scene should be surrounded by two handler points. This applies to every point except for the border points of the curve, who should have only one handle point. The pattern should be as follows: P0 - H0 : H1 - P1 - H1 : ... : Hn - Pn n is the amount of 'P' - points.
curveTension - the tension of the spline
cycle - true if the spline cycle.

Spline

public Spline(Spline.SplineType splineType,
              java.util.List<Vector3f> controlPoints,
              float curveTension,
              boolean cycle)
Create a spline

パラメータ:
splineType - the type of the spline @see {SplineType}
controlPoints - a list of vector to use as control points of the spline If the type of the curve is Bezier curve the control points should be provided in the appropriate way. Each point 'p' describing control position in the scene should be surrounded by two handler points. This applies to every point except for the border points of the curve, who should have only one handle point. The pattern should be as follows: P0 - H0 : H1 - P1 - H1 : ... : Hn - Pn n is the amount of 'P' - points.
curveTension - the tension of the spline
cycle - true if the spline cycle.

Spline

public Spline(java.util.List<Vector4f> controlPoints,
              java.util.List<java.lang.Float> nurbKnots)
Create a NURBS spline. A spline type is automatically set to SplineType.Nurb. The cycle is set to false by default.

パラメータ:
controlPoints - a list of vector to use as control points of the spline
nurbKnots - the nurb's spline knots
メソッドの詳細

addControlPoint

public void addControlPoint(Vector3f controlPoint)
Adds a controlPoint to the spline

パラメータ:
controlPoint - a position in world space

removeControlPoint

public void removeControlPoint(Vector3f controlPoint)
remove the controlPoint from the spline

パラメータ:
controlPoint - the controlPoint to remove

interpolate

public Vector3f interpolate(float value,
                            int currentControlPoint,
                            Vector3f store)
Iterpolate a position on the spline

パラメータ:
value - a value from 0 to 1 that represent the postion between the curent control point and the next one
currentControlPoint - the current control point
store - a vector to store the result (use null to create a new one that will be returned by the method)
戻り値:
the position

getCurveTension

public float getCurveTension()
returns the curve tension


setCurveTension

public void setCurveTension(float curveTension)
sets the curve tension

パラメータ:
curveTension - the tension

isCycle

public boolean isCycle()
returns true if the spline cycle


setCycle

public void setCycle(boolean cycle)
set to true to make the spline cycle

パラメータ:
cycle -

getTotalLength

public float getTotalLength()
return the total lenght of the spline


getType

public Spline.SplineType getType()
return the type of the spline


setType

public void setType(Spline.SplineType type)
Sets the type of the spline

パラメータ:
type -

getControlPoints

public java.util.List<Vector3f> getControlPoints()
returns this spline control points


getSegmentsLength

public java.util.List<java.lang.Float> getSegmentsLength()
returns a list of float representing the segments lenght


getMinNurbKnot

public float getMinNurbKnot()
This method returns the minimum nurb curve knot value. Check the nurb type before calling this method. It the curve is not of a Nurb type - NPE will be thrown.

戻り値:
the minimum nurb curve knot value

getMaxNurbKnot

public float getMaxNurbKnot()
This method returns the maximum nurb curve knot value. Check the nurb type before calling this method. It the curve is not of a Nurb type - NPE will be thrown.

戻り値:
the maximum nurb curve knot value

getKnots

public java.util.List<java.lang.Float> getKnots()
This method returns NURBS' spline knots.

戻り値:
NURBS' spline knots

getWeights

public float[] getWeights()
This method returns NURBS' spline weights.

戻り値:
NURBS' spline weights

getBasisFunctionDegree

public int getBasisFunctionDegree()
This method returns NURBS' spline basis function degree.

戻り値:
NURBS' spline basis function degree

write

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

read

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