com.jme3.animation
クラス AnimControl

java.lang.Object
  上位を拡張 com.jme3.scene.control.AbstractControl
      上位を拡張 com.jme3.animation.AnimControl
すべての実装されたインタフェース:
Savable, Control, java.lang.Cloneable

public final class AnimControl
extends AbstractControl
implements java.lang.Cloneable

AnimControl is a Spatial control that allows manipulation of skeletal animation. The control currently supports: 1) Animation blending/transitions 2) Multiple animation channels 3) Multiple skins 4) Animation event listeners 5) Animated model cloning 6) Animated model binary import/export Planned: 1) Hardware skinning 2) Morph/Pose animation 3) Attachments 4) Add/remove skins


コンストラクタの概要
AnimControl()
          Serialization only.
AnimControl(Skeleton skeleton)
          Creates a new animation control for the given skeleton.
 
メソッドの概要
 void addAnim(Animation anim)
          Adds an animation to be available for playing to this AnimControl.
 void addListener(AnimEventListener listener)
          Adds a new listener to receive animation related events.
 void clearChannels()
          Clears all the channels that were created.
 void clearListeners()
          Clears all the listeners added to this AnimControl
 Control cloneForSpatial(Spatial spatial)
          Internal use only.
 AnimChannel createChannel()
          Create a new animation channel, by default assigned to all bones in the skeleton.
 Animation getAnim(java.lang.String name)
          Retrieve an animation from the list of animations.
 float getAnimationLength(java.lang.String name)
          Returns the length of the given named animation.
 java.util.Collection<java.lang.String> getAnimationNames()
           
 AnimChannel getChannel(int index)
          Return the animation channel at the given index.
 int getNumChannels()
           
 Skeleton getSkeleton()
           
 void read(JmeImporter im)
           
 void removeAnim(Animation anim)
          Remove an animation so that it is no longer available for playing.
 void removeListener(AnimEventListener listener)
          Removes the given listener from listening to events.
 void setAnimations(java.util.HashMap<java.lang.String,Animation> animations)
           
 void setSpatial(Spatial spatial)
          Internal use only.
 void write(JmeExporter ex)
           
 
クラス com.jme3.scene.control.AbstractControl から継承されたメソッド
getSpatial, isEnabled, render, setEnabled, update
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

AnimControl

public AnimControl(Skeleton skeleton)
Creates a new animation control for the given skeleton. The method setAnimations(java.util.HashMap) must be called after initialization in order for this class to be useful.

パラメータ:
skeleton - The skeleton to animate

AnimControl

public AnimControl()
Serialization only. Do not use.

メソッドの詳細

cloneForSpatial

public Control cloneForSpatial(Spatial spatial)
Internal use only.

定義:
インタフェース Control 内の cloneForSpatial
戻り値:
A clone of this control for the spatial

setAnimations

public void setAnimations(java.util.HashMap<java.lang.String,Animation> animations)
パラメータ:
animations - Set the animations that this AnimControl will be capable of playing. The animations should be compatible with the skeleton given in the constructor.

getAnim

public Animation getAnim(java.lang.String name)
Retrieve an animation from the list of animations.

パラメータ:
name - The name of the animation to retrieve.
戻り値:
The animation corresponding to the given name, or null, if no such named animation exists.

addAnim

public void addAnim(Animation anim)
Adds an animation to be available for playing to this AnimControl.

パラメータ:
anim - The animation to add.

removeAnim

public void removeAnim(Animation anim)
Remove an animation so that it is no longer available for playing.

パラメータ:
anim - The animation to remove.

createChannel

public AnimChannel createChannel()
Create a new animation channel, by default assigned to all bones in the skeleton.

戻り値:
A new animation channel for this AnimControl.

getChannel

public AnimChannel getChannel(int index)
Return the animation channel at the given index.

パラメータ:
index - The index, starting at 0, to retrieve the AnimChannel.
戻り値:
The animation channel at the given index, or throws an exception if the index is out of bounds.
例外:
java.lang.IndexOutOfBoundsException - If no channel exists at the given index.

getNumChannels

public int getNumChannels()
戻り値:
The number of channels that are controlled by this AnimControl.
関連項目:
createChannel()

clearChannels

public void clearChannels()
Clears all the channels that were created.

関連項目:
createChannel()

getSkeleton

public Skeleton getSkeleton()
戻り値:
The skeleton of this AnimControl.

addListener

public void addListener(AnimEventListener listener)
Adds a new listener to receive animation related events.

パラメータ:
listener - The listener to add.

removeListener

public void removeListener(AnimEventListener listener)
Removes the given listener from listening to events.

パラメータ:
listener -
関連項目:
addListener(com.jme3.animation.AnimEventListener)

clearListeners

public void clearListeners()
Clears all the listeners added to this AnimControl

関連項目:
addListener(com.jme3.animation.AnimEventListener)

setSpatial

public void setSpatial(Spatial spatial)
Internal use only.

定義:
インタフェース Control 内の setSpatial
オーバーライド:
クラス AbstractControl 内の setSpatial
パラメータ:
spatial - the spatial to be controlled. This should not be called from user code.

getAnimationNames

public java.util.Collection<java.lang.String> getAnimationNames()
戻り値:
The names of all animations that this AnimControl can play.

getAnimationLength

public float getAnimationLength(java.lang.String name)
Returns the length of the given named animation.

パラメータ:
name - The name of the animation
戻り値:
The length of time, in seconds, of the named animation.

write

public void write(JmeExporter ex)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス AbstractControl 内の write
例外:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス AbstractControl 内の read
例外:
java.io.IOException