org.jagatoo.loaders.models.collada.datastructs.animation
Class KeyFrame

java.lang.Object
  extended by org.jagatoo.loaders.models.collada.datastructs.animation.KeyFrame
Direct Known Subclasses:
KeyFrameQuat4f, KeyFrameTuple3f

public abstract class KeyFrame
extends java.lang.Object

A KeyFrame contains information for the animation of a Bone. It can contain translation, rotation or scale information.


Nested Class Summary
static class KeyFrame.Axis
          An Axis.
 
Field Summary
 long time
          Key frame time
 
Constructor Summary
KeyFrame()
           
 
Method Summary
static KeyFrame buildPoint3fKeyFrame(float time, float[] values, int valueIndex)
          Creates a translation key frame
static KeyFrame buildQuaternion4fKeyFrame(float time, float angle, KeyFrame.Axis axis)
          Creates a rotation key frame
static int searchNextFrame(java.util.List<? extends KeyFrame> frames, long currentTime)
          Searches the next key frame according to the current time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

time

public long time
Key frame time

Constructor Detail

KeyFrame

public KeyFrame()
Method Detail

buildPoint3fKeyFrame

public static KeyFrame buildPoint3fKeyFrame(float time,
                                            float[] values,
                                            int valueIndex)
Creates a translation key frame

Parameters:
time - frame time
values - float values of the translation
valueIndex - first value index
Returns:
a new key frame

buildQuaternion4fKeyFrame

public static KeyFrame buildQuaternion4fKeyFrame(float time,
                                                 float angle,
                                                 KeyFrame.Axis axis)
Creates a rotation key frame

Parameters:
time - frame time
angle - rotation angle in degrees
axis - the axis of the rotation
Returns:
a new key frame

searchNextFrame

public static int searchNextFrame(java.util.List<? extends KeyFrame> frames,
                                  long currentTime)
Searches the next key frame according to the current time.

Parameters:
frames -
currentTime - in milliseconds
Returns:
selected key frame index