libgdx API

com.badlogic.gdx.graphics.g3d.keyframed
Class KeyframeAnimator

java.lang.Object
  extended by com.badlogic.gdx.graphics.g3d.Animator
      extended by com.badlogic.gdx.graphics.g3d.keyframed.KeyframeAnimator

public class KeyframeAnimator
extends Animator

An animation controller for keyframed animations.

Author:
Dave Clayton

Nested Class Summary
 
Nested classes/interfaces inherited from class com.badlogic.gdx.graphics.g3d.Animator
Animator.WrapMode
 
Field Summary
static int sStride
           
 
Fields inherited from class com.badlogic.gdx.graphics.g3d.Animator
mAnimLen, mAnimPos, mCurrentAnim, mCurrentFrameIdx, mFrameDelta, mNextFrameIdx, mWrapMode
 
Constructor Summary
KeyframeAnimator(int numMeshes, float sampleRate)
          Constructs a new KeyframeAnimator.
 
Method Summary
 Keyframe getInterpolatedKeyframe()
          Get the current Keyframe.
 boolean hasAnimation()
          Whether the controller is currently playing an animation.
protected  void interpolate()
          Implementations should interpolate between the 'current' and 'next' frames of animation.
protected  void setInterpolationFrames()
          Implementations should set the 'current' and 'next' frames of animation that will be interpolated.
 void setKeyframeDimensions(int idx, int numVertices, int numIndices)
          Set the result (interpolated) keyframe internal array dimensions.
 void setNumTaggedJoints(int num)
          Set the number of tagged joints for allocation
 
Methods inherited from class com.badlogic.gdx.graphics.g3d.Animator
getCurrentAnimation, getCurrentWrapMode, setAnimation, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sStride

public static final int sStride
See Also:
Constant Field Values
Constructor Detail

KeyframeAnimator

public KeyframeAnimator(int numMeshes,
                        float sampleRate)
Constructs a new KeyframeAnimator.

Parameters:
numMeshes - The number of meshes in the KeyframedModel.
sampleRate - The sample rate used to make the KeyframeAnimations.
Method Detail

getInterpolatedKeyframe

public Keyframe getInterpolatedKeyframe()
Get the current Keyframe.

Returns:
the current keyframe.

setKeyframeDimensions

public void setKeyframeDimensions(int idx,
                                  int numVertices,
                                  int numIndices)
Set the result (interpolated) keyframe internal array dimensions.

Parameters:
idx - The index of the mesh the keyframe represents.
numVertices - The number of vertices the mesh has.
numIndices - The number of indices the mesh has.

setNumTaggedJoints

public void setNumTaggedJoints(int num)
Set the number of tagged joints for allocation

Parameters:
num -

setInterpolationFrames

protected void setInterpolationFrames()
Description copied from class: Animator
Implementations should set the 'current' and 'next' frames of animation that will be interpolated.

Specified by:
setInterpolationFrames in class Animator

interpolate

protected void interpolate()
Description copied from class: Animator
Implementations should interpolate between the 'current' and 'next' frames of animation.

Specified by:
interpolate in class Animator

hasAnimation

public boolean hasAnimation()
Whether the controller is currently playing an animation.

Returns:
If an animation is being played.

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)