com.jme3.scene.plugins.blender.animations
Class Ipo

java.lang.Object
  extended by com.jme3.scene.plugins.blender.animations.Ipo

public class Ipo
extends java.lang.Object

This class is used to calculate bezier curves value for the given frames. The Ipo (interpolation object) consists of several b-spline curves (connected 3rd degree bezier curves) of a different type.


Field Summary
static int AC_LOC_X
           
static int AC_LOC_Y
           
static int AC_LOC_Z
           
static int AC_QUAT_W
           
static int AC_QUAT_X
           
static int AC_QUAT_Y
           
static int AC_QUAT_Z
           
static int AC_SIZE_X
           
static int AC_SIZE_Y
           
static int AC_SIZE_Z
           
protected  boolean fixUpAxis
          This variable indicates if the Y asxis is the UP axis or not.
static int OB_ROT_X
           
static int OB_ROT_Y
           
static int OB_ROT_Z
           
 
Constructor Summary
Ipo(BezierCurve[] bezierCurves, boolean fixUpAxis)
          Constructor.
 
Method Summary
 Track calculateTrack(int targetIndex, int startFrame, int stopFrame, int fps, boolean spatialTrack)
          This method calculates the value of the curves as a bone track between the specified frames.
 float calculateValue(int frame)
          This method calculates the ipo value for the first curve.
 float calculateValue(int frame, int curveIndex)
          This method calculates the ipo value for the curve of the specified index.
 int getCurvesAmount()
          This method returns the curves amount.
 int getLastFrame()
          This method returns the frame where last bezier triple center point of the specified bezier curve is located.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AC_LOC_X

public static final int AC_LOC_X
See Also:
Constant Field Values

AC_LOC_Y

public static final int AC_LOC_Y
See Also:
Constant Field Values

AC_LOC_Z

public static final int AC_LOC_Z
See Also:
Constant Field Values

OB_ROT_X

public static final int OB_ROT_X
See Also:
Constant Field Values

OB_ROT_Y

public static final int OB_ROT_Y
See Also:
Constant Field Values

OB_ROT_Z

public static final int OB_ROT_Z
See Also:
Constant Field Values

AC_SIZE_X

public static final int AC_SIZE_X
See Also:
Constant Field Values

AC_SIZE_Y

public static final int AC_SIZE_Y
See Also:
Constant Field Values

AC_SIZE_Z

public static final int AC_SIZE_Z
See Also:
Constant Field Values

AC_QUAT_W

public static final int AC_QUAT_W
See Also:
Constant Field Values

AC_QUAT_X

public static final int AC_QUAT_X
See Also:
Constant Field Values

AC_QUAT_Y

public static final int AC_QUAT_Y
See Also:
Constant Field Values

AC_QUAT_Z

public static final int AC_QUAT_Z
See Also:
Constant Field Values

fixUpAxis

protected boolean fixUpAxis
This variable indicates if the Y asxis is the UP axis or not.

Constructor Detail

Ipo

public Ipo(BezierCurve[] bezierCurves,
           boolean fixUpAxis)
Constructor. Stores the bezier curves.

Parameters:
bezierCurves - a table of bezier curves
Method Detail

calculateValue

public float calculateValue(int frame)
This method calculates the ipo value for the first curve.

Parameters:
frame - the frame for which the value is calculated
Returns:
calculated ipo value

calculateValue

public float calculateValue(int frame,
                            int curveIndex)
This method calculates the ipo value for the curve of the specified index. Make sure you do not exceed the curves amount. Alway chech the amount of curves before calling this method.

Parameters:
frame - the frame for which the value is calculated
curveIndex - the index of the curve
Returns:
calculated ipo value

getCurvesAmount

public int getCurvesAmount()
This method returns the curves amount.

Returns:
the curves amount

getLastFrame

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

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

calculateTrack

public Track calculateTrack(int targetIndex,
                            int startFrame,
                            int stopFrame,
                            int fps,
                            boolean spatialTrack)
This method calculates the value of the curves as a bone track between the specified frames.

Parameters:
targetIndex - the index of the target for which the method calculates the tracks IMPORTANT! Aet to -1 (or any negative number) if you want to load spatial animation.
startFrame - the firs frame of tracks (inclusive)
stopFrame - the last frame of the tracks (inclusive)
fps - frame rate (frames per second)
spatialTrack - this flag indicates if the track belongs to a spatial or to a bone; the diference is important because it appears that bones in blender have the same type of coordinate system (Y as UP) as jme while other features have different one (Z is UP)
Returns:
bone track for the specified bone