com.jme3.scene.plugins.blender.curves
Class BezierCurve

java.lang.Object
  extended by com.jme3.scene.plugins.blender.curves.BezierCurve

public class BezierCurve
extends java.lang.Object

A class that helps to calculate the bezier curves calues. It uses doubles for performing calculations to minimize floating point operations errors.


Field Summary
static int X_VALUE
           
static int Y_VALUE
           
static int Z_VALUE
           
 
Constructor Summary
BezierCurve(int type, java.util.List<Structure> bezTriples, int dimension)
           
 
Method Summary
 float evaluate(int frame, int valuePart)
          This method evaluates the data for the specified frame.
 java.util.List<Vector3f> getControlPoints()
          This method returns a list of control points for this curve.
 int getLastFrame()
          This method returns the frame where last bezier triple center point of the bezier curve is located.
 int getType()
          This method returns the type of the bezier curve.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

X_VALUE

public static final int X_VALUE
See Also:
Constant Field Values

Y_VALUE

public static final int Y_VALUE
See Also:
Constant Field Values

Z_VALUE

public static final int Z_VALUE
See Also:
Constant Field Values
Constructor Detail

BezierCurve

public BezierCurve(int type,
                   java.util.List<Structure> bezTriples,
                   int dimension)
Method Detail

evaluate

public float evaluate(int frame,
                      int valuePart)
This method evaluates the data for the specified frame. The Y value is returned.

Parameters:
frame - the frame for which the value is being calculated
valuePart - this param specifies wheather we should return the X, Y or Z part of the result value; it should have one of the following values: X_VALUE - the X factor of the result Y_VALUE - the Y factor of the result Z_VALUE - the Z factor of the result
Returns:
the value of the curve

getLastFrame

public int getLastFrame()
This method returns the frame where last bezier triple center point of the bezier curve is located.

Returns:
the frame number of the last defined bezier triple point for the curve

getType

public int getType()
This method returns the type of the bezier curve. The type describes the parameter that this curve modifies (ie. LocationX or rotationW of the feature).

Returns:
the type of the bezier curve

getControlPoints

public java.util.List<Vector3f> getControlPoints()
This method returns a list of control points for this curve.

Returns:
a list of control points for this curve.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object