jglanim
Class JGL_Skeleton

java.lang.Object
  extended by jglanim.JGL_Skeleton

public final class JGL_Skeleton
extends java.lang.Object

Representation of an animated hierarchical skeleton.

Author:
Nicolas Devere

Field Summary
static short BY_FRAME_ANIMATION
          Animation mode in witch no interpolation is used between the different keyframes.
static short CUBIC_ANIMATION
          Animation mode in witch a cubic interpolation is used between the different keyframes.
static short LINEAR_ANIMATION
          Animation mode in witch a linear interpolation is used between the different keyframes.
 
Constructor Summary
JGL_Skeleton(java.util.Vector _bones)
          Constructs a skeleton given a bones list.
 
Method Summary
 JGL_Bone getBoneByID(java.lang.String id)
          Returns the bone identified by the specified ID, or null if it's not found.
 JGL_Bone[] getBones()
          Returns the skeleton's bones array.
 JGL_Bone getSkeletonRoot()
          Returns the skeleton in its recursive form.
 void mapPointsBones(java.util.Vector mapPointsBones)
          Configures the skeleton with the specified points indexes/bones indexes mapping list by adding to each bone its corresponding point indexes.
 void moveBackward(java.util.Vector points, float deltaT)
          Moves forward the skeleton according to the specified parametric lapse.
 void moveForward(java.util.Vector points, float deltaT)
          Moves forward the skeleton according to the specified parametric lapse.
 void moveHere(java.util.Vector points, float t)
          Moves the skeleton to the specified parametric variables's place.
 void setAnimationMode(short mode)
          Sets the skeleton's animation mode with the specified JGL_Skeleton's animation constant (ex. : JGL_Skeleton.LINEAR_ANIMATION).
 int sizeFrames()
          Returns the frames number in the skeleton.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BY_FRAME_ANIMATION

public static final short BY_FRAME_ANIMATION
Animation mode in witch no interpolation is used between the different keyframes.
This mode can be chosen by the JGL_Skeleton.set_animation_mode() method.

See Also:
Constant Field Values

LINEAR_ANIMATION

public static final short LINEAR_ANIMATION
Animation mode in witch a linear interpolation is used between the different keyframes.
This mode can be chosen by the JGL_Skeleton.set_animation_mode() method.

See Also:
Constant Field Values

CUBIC_ANIMATION

public static final short CUBIC_ANIMATION
Animation mode in witch a cubic interpolation is used between the different keyframes.
This mode can be chosen by the JGL_Skeleton.set_animation_mode() method.

See Also:
Constant Field Values
Constructor Detail

JGL_Skeleton

public JGL_Skeleton(java.util.Vector _bones)
Constructs a skeleton given a bones list. The keyframes number in the skeleton is given by the root bone's one.

Parameters:
_bones - : the bones list
Method Detail

mapPointsBones

public void mapPointsBones(java.util.Vector mapPointsBones)
Configures the skeleton with the specified points indexes/bones indexes mapping list by adding to each bone its corresponding point indexes.

Parameters:
mapPointsBones - : the points indexes/bones indexes mapping list

getSkeletonRoot

public JGL_Bone getSkeletonRoot()
Returns the skeleton in its recursive form.

Returns:
the skeleton root

getBones

public JGL_Bone[] getBones()
Returns the skeleton's bones array.

Returns:
the ordered bones array

getBoneByID

public JGL_Bone getBoneByID(java.lang.String id)
Returns the bone identified by the specified ID, or null if it's not found.

Parameters:
id - : the bone ID
Returns:
the corresponding bone object, or null if not found

sizeFrames

public int sizeFrames()
Returns the frames number in the skeleton. It's given by the root bone's one.

Returns:
the frames number

setAnimationMode

public void setAnimationMode(short mode)
Sets the skeleton's animation mode with the specified JGL_Skeleton's animation constant (ex. : JGL_Skeleton.LINEAR_ANIMATION).

Parameters:
mode - : animation constant (ex. : JGL_Skeleton.LINEAR_ANIMATION)

moveForward

public void moveForward(java.util.Vector points,
                        float deltaT)
Moves forward the skeleton according to the specified parametric lapse.

Parameters:
points - : all the moving points
deltaT - : the parametric lapse

moveBackward

public void moveBackward(java.util.Vector points,
                         float deltaT)
Moves forward the skeleton according to the specified parametric lapse.

Parameters:
points - : all the moving points
deltaT - : the parametric lapse

moveHere

public void moveHere(java.util.Vector points,
                     float t)
Moves the skeleton to the specified parametric variables's place.

Parameters:
points - : all the moving points
t - : the parametric variable