jglanim
Class JGL_KeyframesArray

java.lang.Object
  extended by jglanim.JGL_KeyframesArray

public final class JGL_KeyframesArray
extends java.lang.Object

Represents a keyframes array list. A JGL_KeyframesArray can store several keyframes and manage linear and cubic interpolations along the list.

Author:
Nicolas Devere

Constructor Summary
JGL_KeyframesArray()
          Constructs a new keyframes array list.
 
Method Summary
 void add(JGL_Keyframe keyframe)
          Adds a keyframe to the list.
 void clear()
          Removes all the keyframes from the list.
 JGL_Keyframe get(int index)
          Returns the keyframe at the specified position in the list, or null if the list is empty.
 void interpolationCubic(float p, JGL_Keyframe result)
          Assigns to result the list's cubic interpolation keyframe according to the specified parametric variable.
 void interpolationLinear(float p, JGL_Keyframe result)
          Assigns to result the list's linear interpolation keyframe according to the specified parametric variable.
 void remove(int index)
          Removes the keyframe at the specified position in the list.
 int size()
          Returns the keyframes number in the list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGL_KeyframesArray

public JGL_KeyframesArray()
Constructs a new keyframes array list.

Method Detail

add

public void add(JGL_Keyframe keyframe)
Adds a keyframe to the list.

Parameters:
keyframe - : the keyframe to add

size

public int size()
Returns the keyframes number in the list.

Returns:
the keyframes number

get

public JGL_Keyframe get(int index)
Returns the keyframe at the specified position in the list, or null if the list is empty.

Parameters:
index - : the keyframe's index
Returns:
the keyframe or null if the list is empty

remove

public void remove(int index)
Removes the keyframe at the specified position in the list.

Parameters:
index - : the keyframe's index to remove

clear

public void clear()
Removes all the keyframes from the list.


interpolationLinear

public final void interpolationLinear(float p,
                                      JGL_Keyframe result)
Assigns to result the list's linear interpolation keyframe according to the specified parametric variable.

Parameters:
p - : the parametric variable
result - : the interpolated keyframe result

interpolationCubic

public final void interpolationCubic(float p,
                                     JGL_Keyframe result)
Assigns to result the list's cubic interpolation keyframe according to the specified parametric variable.

Parameters:
p - : the parametric variable
result - : the interpolated keyframe result