Package com.jme3.anim
Class AnimComposer
java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.anim.AnimComposer
- All Implemented Interfaces:
- Savable,- Control,- JmeCloneable,- Cloneable
AnimComposer is a Spatial control that allows manipulation of
 
armature (skeletal) animation.- 
Field SummaryFieldsFields inherited from class com.jme3.scene.control.AbstractControlenabled, spatial
- 
Constructor SummaryConstructorsConstructorDescriptionInstantiate a composer with a single layer, no actions, and no clips.
- 
Method SummaryModifier and TypeMethodDescriptionactionBlended(String name, BlendSpace blendSpace, String... clips) Creates an action that blends the named clips using the given blend space.actionSequence(String name, Tween... tweens) Creates an action that will interpolate over an entire sequence of tweens in order.voidRegister given action with specified name.voidaddAnimClip(AnimClip anim) Adds an animation to be available for playing to thisAnimControl.voidcloneFields(Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned composer into a deep-cloned one, using the specified Cloner and original to resolve copied fields.protected voidcontrolRender(RenderManager rm, ViewPort vp) used internallyprotected voidcontrolUpdate(float tpf) used internallygetAnimClip(String name) Retrieve an animation from the list of animations.Returns an unmodifiable collection of all available animations.Returns an unmodifiable set of all available animation names.Return the current action on the default layer.getCurrentAction(String layerName) Return current action on specified layer.floatDetermine the global speed applied to all layers.Provides access to the named layer.getLayerManager(String layerName) Access the manager of the named layer.Enumerates the names of all layers.doublegetTime()Returns current time of the default layer.doubleReturns current time of the specified layer.booleanTells if an action is contained in the list of actions.booleanhasAnimClip(String name) Tells if an animation is contained in the list of animations.jmeClone()Create a shallow clone for the JME cloner.makeAction(String name) Create a new ClipAction with specified clip name.voidmakeLayer(String name, AnimationMask mask) Add a layer to this composer.voidread(JmeImporter im) De-serialize this composer from the specified importer, for example when loading from a J3O file.removeAction(String name) Remove specified action.voidremoveAnimClip(AnimClip anim) Remove an animation so that it is no longer available for playing.voidRemove current action on default layer.voidremoveCurrentAction(String layerName) Remove current action on specified layer.voidremoveLayer(String name) Remove specified layer.voidreset()Reset all layers to t=0 with no current action.setCurrentAction(String name) Run an action on the default layer.setCurrentAction(String actionName, String layerName) Run an action on specified layer.setCurrentAction(String actionName, String layerName, boolean loop) Run an action on specified layer.voidsetGlobalSpeed(float globalSpeed) Alter the global speed applied to all layers.voidsetLayerManager(String layerName, Object manager) Assign a manager to the named layer.voidsetTime(double time) Sets current time on the default layer.voidSets current time on the specified layer.voidwrite(JmeExporter ex) Serialize this composer to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.scene.control.AbstractControlcloneForSpatial, getSpatial, isEnabled, render, setEnabled, setSpatial, update
- 
Field Details- 
DEFAULT_LAYERThe name of the default layer.- See Also:
 
 
- 
- 
Constructor Details- 
AnimComposerpublic AnimComposer()Instantiate a composer with a single layer, no actions, and no clips.
 
- 
- 
Method Details- 
hasAnimClipTells if an animation is contained in the list of animations.- Parameters:
- name- The name of the animation.
- Returns:
- true, if the named animation is in the list of animations.
 
- 
getAnimClipRetrieve an animation from the list of animations.- Parameters:
- name- The name of the animation to retrieve.
- Returns:
- The animation corresponding to the given name, or null, if no such named animation exists.
 
- 
addAnimClipAdds an animation to be available for playing to thisAnimControl.- Parameters:
- anim- The animation to add.
 
- 
removeAnimClipRemove an animation so that it is no longer available for playing.- Parameters:
- anim- The animation to remove.
 
- 
setCurrentActionRun an action on the default layer. By default action will loop.- Parameters:
- name- The name of the action to run.
- Returns:
- The action corresponding to the given name.
 
- 
setCurrentActionRun an action on specified layer. By default action will loop.- Parameters:
- actionName- The name of the action to run.
- layerName- The layer on which action should run.
- Returns:
- The action corresponding to the given name.
 
- 
setCurrentActionRun an action on specified layer.- Parameters:
- actionName- The name of the action to run.
- layerName- The layer on which action should run.
- loop- True if the action must loop.
- Returns:
- The action corresponding to the given name.
 
- 
getCurrentActionReturn the current action on the default layer.- Returns:
- The action corresponding to the given name.
 
- 
getCurrentActionReturn current action on specified layer.- Parameters:
- layerName- The layer on which action should run.
- Returns:
- The action corresponding to the given name.
 
- 
removeCurrentActionpublic void removeCurrentAction()Remove current action on default layer.
- 
removeCurrentActionRemove current action on specified layer.- Parameters:
- layerName- The name of the layer we want to remove its action.
 
- 
getTimepublic double getTime()Returns current time of the default layer.- Returns:
- The current time.
 
- 
getTimeReturns current time of the specified layer.- Parameters:
- layerName- The layer from which to get the time.
- Returns:
- the time (in seconds)
 
- 
setTimepublic void setTime(double time) Sets current time on the default layer.- Parameters:
- time- the desired time (in seconds)
 
- 
setTimeSets current time on the specified layer.- Parameters:
- layerName- the name of the Layer to modify
- time- the desired time (in seconds)
 
- 
action- Parameters:
- name- The name of the action to return.
- Returns:
- The action registered with specified name. It will make a new action if there isn't any.
- See Also:
 
- 
getAction- Parameters:
- name- The name of the action to return.
- Returns:
- The action registered with specified name or null if nothing is registered.
 
- 
addActionRegister given action with specified name.- Parameters:
- name- The name of the action.
- action- The action to add.
 
- 
makeActionCreate a new ClipAction with specified clip name.- Parameters:
- name- The name of the clip.
- Returns:
- a new action
- Throws:
- IllegalArgumentException- if clip with specified name not found.
 
- 
hasActionTells if an action is contained in the list of actions.- Parameters:
- name- The name of the action.
- Returns:
- true, if the named action is in the list of actions.
 
- 
removeActionRemove specified action.- Parameters:
- name- The name of the action to remove.
- Returns:
- The removed action.
 
- 
makeLayerAdd a layer to this composer.- Parameters:
- name- the desired name for the new layer
- mask- the desired mask for the new layer (alias created)
 
- 
removeLayerRemove specified layer. This will stop the current action on this layer.- Parameters:
- name- The name of the layer to remove.
 
- 
actionSequenceCreates an action that will interpolate over an entire sequence of tweens in order.- Parameters:
- name- a name for the new Action
- tweens- the desired sequence of tweens
- Returns:
- a new instance
 
- 
actionBlendedCreates an action that blends the named clips using the given blend space.- Parameters:
- name- a name for the new Action
- blendSpace- how to blend the clips (not null, alias created)
- clips- the names of the clips to be used (not null)
- Returns:
- a new instance
 
- 
resetpublic void reset()Reset all layers to t=0 with no current action.
- 
getAnimClipsReturns an unmodifiable collection of all available animations. When an attempt is made to modify the collection, an UnsupportedOperationException is thrown.- Returns:
- the unmodifiable collection of animations
 
- 
getAnimClipsNamesReturns an unmodifiable set of all available animation names. When an attempt is made to modify the set, an UnsupportedOperationException is thrown.- Returns:
- the unmodifiable set of animation names.
 
- 
controlUpdateprotected void controlUpdate(float tpf) used internally- Specified by:
- controlUpdatein class- AbstractControl
- Parameters:
- tpf- time per frame (in seconds)
 
- 
controlRenderused internally- Specified by:
- controlRenderin class- AbstractControl
- Parameters:
- rm- the RenderManager rendering the controlled Spatial (not null)
- vp- the ViewPort being rendered (not null)
 
- 
getGlobalSpeedpublic float getGlobalSpeed()Determine the global speed applied to all layers.- Returns:
- the speed factor (1=normal speed)
 
- 
setGlobalSpeedpublic void setGlobalSpeed(float globalSpeed) Alter the global speed applied to all layers.- Parameters:
- globalSpeed- the desired speed factor (1=normal speed, default=1)
 
- 
getLayerProvides access to the named layer.- Parameters:
- layerName- the name of the layer to access
- Returns:
- the pre-existing instance
 
- 
getLayerManagerAccess the manager of the named layer.- Parameters:
- layerName- the name of the layer to access
- Returns:
- the current manager (typically an AnimEvent) or null for none
 
- 
getLayerNamesEnumerates the names of all layers.- Returns:
- an unmodifiable set of names
 
- 
setLayerManagerAssign a manager to the named layer.- Parameters:
- layerName- the name of the layer to modify
- manager- the desired manager (typically an AnimEvent) or null for none
 
- 
jmeCloneCreate a shallow clone for the JME cloner.- Specified by:
- jmeClonein interface- JmeCloneable
- Overrides:
- jmeClonein class- AbstractControl
- Returns:
- a new instance
 
- 
cloneFieldsCallback fromClonerto convert this shallow-cloned composer into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
- cloneFieldsin interface- JmeCloneable
- Overrides:
- cloneFieldsin class- AbstractControl
- Parameters:
- cloner- the Cloner that's cloning this composer (not null)
- original- the instance from which this composer was shallow-cloned (not null, unaffected)
 
- 
readDe-serialize this composer from the specified importer, for example when loading from a J3O file.- Specified by:
- readin interface- Savable
- Overrides:
- readin class- AbstractControl
- Parameters:
- im- the importer to use (not null)
- Throws:
- IOException- from the importer
 
- 
writeSerialize this composer to the specified exporter, for example when saving to a J3O file.- Specified by:
- writein interface- Savable
- Overrides:
- writein class- AbstractControl
- Parameters:
- ex- the exporter to use (not null)
- Throws:
- IOException- from the exporter
 
 
-