com.jme3.animation
Class AnimChannel

java.lang.Object
  extended by com.jme3.animation.AnimChannel

public final class AnimChannel
extends java.lang.Object

AnimChannel provides controls, such as play, pause, fast forward, etc, for an animation. The animation channel may influence the entire model or specific bones of the model's skeleton. A single model may have multiple animation channels influencing various parts of its body. For example, a character model may have an animation channel for its feet, and another for its torso, and the animations for each channel are controlled independently.


Method Summary
 void addAllBones()
          Add all the bones of the model's skeleton to be influenced by this animation channel.
 void addBone(Bone bone)
          Add a single bone to be influenced by this animation channel.
 void addBone(java.lang.String name)
          Add a single bone to be influenced by this animation channel.
 void addFromRootBone(Bone bone)
          Add bones to be influenced by this animation channel, starting from the given bone and going toward its children.
 void addFromRootBone(java.lang.String name)
          Add bones to be influenced by this animation channel, starting from the given named bone and going toward its children.
 void addToRootBone(Bone bone)
          Add bones to be influenced by this animation channel starting from the given bone and going toward the root bone.
 void addToRootBone(java.lang.String name)
          Add bones to be influenced by this animation channel starting from the given bone name and going toward the root bone.
 java.lang.String getAnimationName()
           
 float getAnimMaxTime()
           
 AnimControl getControl()
          Returns the parent control of this AnimChannel.
 LoopMode getLoopMode()
           
 float getSpeed()
           
 float getTime()
           
 void reset(boolean rewind)
           
 void setAnim(java.lang.String name)
          Set the current animation that is played by this AnimChannel.
 void setAnim(java.lang.String name, float blendTime)
          Set the current animation that is played by this AnimChannel.
 void setLoopMode(LoopMode loopMode)
           
 void setSpeed(float speed)
           
 void setTime(float time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getControl

public AnimControl getControl()
Returns the parent control of this AnimChannel.

Returns:
the parent control of this AnimChannel.
See Also:
AnimControl

getAnimationName

public java.lang.String getAnimationName()
Returns:
The name of the currently playing animation, or null if none is assigned.
See Also:
setAnim(java.lang.String)

getLoopMode

public LoopMode getLoopMode()
Returns:
The loop mode currently set for the animation. The loop mode determines what will happen to the animation once it finishes playing. For more information, see the LoopMode enum class.
See Also:
LoopMode, setLoopMode(com.jme3.animation.LoopMode)

setLoopMode

public void setLoopMode(LoopMode loopMode)
Parameters:
loopMode - Set the loop mode for the channel. The loop mode determines what will happen to the animation once it finishes playing. For more information, see the LoopMode enum class.
See Also:
LoopMode

getSpeed

public float getSpeed()
Returns:
The speed that is assigned to the animation channel. The speed is a scale value starting from 0.0, at 1.0 the animation will play at its default speed.
See Also:
setSpeed(float)

setSpeed

public void setSpeed(float speed)
Parameters:
speed - Set the speed of the animation channel. The speed is a scale value starting from 0.0, at 1.0 the animation will play at its default speed.

getTime

public float getTime()
Returns:
The time of the currently playing animation. The time starts at 0 and continues on until getAnimMaxTime().
See Also:
setTime(float)

setTime

public void setTime(float time)
Parameters:
time - Set the time of the currently playing animation, the time is clamped from 0 to getAnimMaxTime().

getAnimMaxTime

public float getAnimMaxTime()
Returns:
The length of the currently playing animation, or zero if no animation is playing.
See Also:
getTime()

setAnim

public void setAnim(java.lang.String name,
                    float blendTime)
Set the current animation that is played by this AnimChannel.

This resets the time to zero, and optionally blends the animation over blendTime seconds with the currently playing animation. Notice that this method will reset the control's speed to 1.0.

Parameters:
name - The name of the animation to play
blendTime - The blend time over which to blend the new animation with the old one. If zero, then no blending will occur and the new animation will be applied instantly.

setAnim

public void setAnim(java.lang.String name)
Set the current animation that is played by this AnimChannel.

See setAnim(java.lang.String, float). The blendTime argument by default is 150 milliseconds.

Parameters:
name - The name of the animation to play

addAllBones

public void addAllBones()
Add all the bones of the model's skeleton to be influenced by this animation channel.


addBone

public void addBone(java.lang.String name)
Add a single bone to be influenced by this animation channel.


addBone

public void addBone(Bone bone)
Add a single bone to be influenced by this animation channel.


addToRootBone

public void addToRootBone(java.lang.String name)
Add bones to be influenced by this animation channel starting from the given bone name and going toward the root bone.


addToRootBone

public void addToRootBone(Bone bone)
Add bones to be influenced by this animation channel starting from the given bone and going toward the root bone.


addFromRootBone

public void addFromRootBone(java.lang.String name)
Add bones to be influenced by this animation channel, starting from the given named bone and going toward its children.


addFromRootBone

public void addFromRootBone(Bone bone)
Add bones to be influenced by this animation channel, starting from the given bone and going toward its children.


reset

public void reset(boolean rewind)