org.jagatoo.loaders.models.cal3d.core
Class CalAnimation

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.core.CalAnimation
Direct Known Subclasses:
CalAnimationAction, CalAnimationCycle

public class CalAnimation
extends java.lang.Object

The animation class.


Field Summary
protected  CalCoreAnimation coreAnimation
           
protected  int state
           
static int STATE_ASYNC
           
static int STATE_IN
           
static int STATE_NONE
           
static int STATE_OUT
           
static int STATE_STEADY
           
static int STATE_STOPPED
           
static int STATE_SYNC
           
protected  float time
           
protected  float timeFactor
           
protected  int type
           
static int TYPE_ACTION
           
static int TYPE_CYCLE
           
static int TYPE_NONE
           
static int TYPE_POSE
           
protected  float weight
           
 
Constructor Summary
CalAnimation()
          Constructs the animation instance.
 
Method Summary
 void freeze(float time, float weight)
           
 CalCoreAnimation getCoreAnimation()
          Provides access to the core animation.
 int getState()
          Returns the state.
 float getTime()
          Returns the time.
 float getTimeFactor()
          Get the time factor.
 int getType()
          Returns the type.
 float getWeight()
          Returns the weight.
 void setRootDisplacement(org.openmali.vecmath2.Vector3f displacement)
          Applies a displacement to the root bone throughout - useful for aligning anims in different reference frames.
 void setRootRotation(org.openmali.vecmath2.Quaternion4f rotation)
          Applies a rotation to the root bone throughout - useful for aligning anims in different reference frames.
 void setTimeFactor(float timeFactor)
          Set the time factor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NONE

public static final int TYPE_NONE
See Also:
Constant Field Values

TYPE_CYCLE

public static final int TYPE_CYCLE
See Also:
Constant Field Values

TYPE_POSE

public static final int TYPE_POSE
See Also:
Constant Field Values

TYPE_ACTION

public static final int TYPE_ACTION
See Also:
Constant Field Values

STATE_NONE

public static final int STATE_NONE
See Also:
Constant Field Values

STATE_SYNC

public static final int STATE_SYNC
See Also:
Constant Field Values

STATE_ASYNC

public static final int STATE_ASYNC
See Also:
Constant Field Values

STATE_IN

public static final int STATE_IN
See Also:
Constant Field Values

STATE_STEADY

public static final int STATE_STEADY
See Also:
Constant Field Values

STATE_OUT

public static final int STATE_OUT
See Also:
Constant Field Values

STATE_STOPPED

public static final int STATE_STOPPED
See Also:
Constant Field Values

coreAnimation

protected CalCoreAnimation coreAnimation

type

protected int type

state

protected int state

time

protected float time

timeFactor

protected float timeFactor

weight

protected float weight
Constructor Detail

CalAnimation

public CalAnimation()
Constructs the animation instance. This function is the default constructor of the animation instance.

Method Detail

getCoreAnimation

public CalCoreAnimation getCoreAnimation()
Provides access to the core animation. This function returns the core animation on which this animation instance is based on.

Returns:
One of the following values: \li a pointer to the core animation \li \b 0 if an error happend

getState

public int getState()
Returns the state. This function returns the state of the animation instance.

Returns:
One of the following states: \li \b STATE_NONE \li \b STATE_SYNC \li \b STATE_ASYNC \li \b STATE_IN \li \b STATE_STEADY \li \b STATE_OUT

getTime

public float getTime()
Returns the time. This function returns the time of the animation instance.

Returns:
The time in seconds.

getType

public int getType()
Returns the type. This function returns the type of the animation instance.

Returns:
One of the following types: \li \b TYPE_NONE \li \b TYPE_CYCLE \li \b TYPE_POSE \li \b TYPE_ACTION

getWeight

public float getWeight()
Returns the weight. This function returns the weight of the animation instance.

Returns:
The weight.

freeze

public void freeze(float time,
                   float weight)

getTimeFactor

public float getTimeFactor()
Get the time factor.

Returns:
the time factor of the animation instance.

setTimeFactor

public void setTimeFactor(float timeFactor)
Set the time factor. This time factor affects only sync animation

Parameters:
timeFactor - the time factor of the animation instance.

setRootDisplacement

public void setRootDisplacement(org.openmali.vecmath2.Vector3f displacement)
Applies a displacement to the root bone throughout - useful for aligning anims in different reference frames.


setRootRotation

public void setRootRotation(org.openmali.vecmath2.Quaternion4f rotation)
Applies a rotation to the root bone throughout - useful for aligning anims in different reference frames.