public class AnimComposer extends AbstractControl
armature
(skeletal) animation.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_LAYER
The name of the default layer.
|
enabled, spatial
Constructor and Description |
---|
AnimComposer()
Instantiate a composer with a single layer, no actions, and no clips.
|
Modifier and Type | Method and Description |
---|---|
Action |
action(java.lang.String name) |
BlendAction |
actionBlended(java.lang.String name,
BlendSpace blendSpace,
java.lang.String... clips)
Creates an action that blends the named clips using the given blend
space.
|
BaseAction |
actionSequence(java.lang.String name,
Tween... tweens)
Creates an action that will interpolate over an entire sequence
of tweens in order.
|
void |
addAction(java.lang.String name,
Action action)
Register given action with specified name.
|
void |
addAnimClip(AnimClip anim)
Adds an animation to be available for playing to this
AnimControl . |
void |
cloneFields(Cloner cloner,
java.lang.Object original)
Callback from
Cloner to convert this
shallow-cloned composer into a deep-cloned one, using the specified
Cloner and original to resolve copied fields. |
protected void |
controlRender(RenderManager rm,
ViewPort vp)
used internally
|
protected void |
controlUpdate(float tpf)
used internally
|
Action |
getAction(java.lang.String name) |
AnimClip |
getAnimClip(java.lang.String name)
Retrieve an animation from the list of animations.
|
java.util.Collection<AnimClip> |
getAnimClips()
Returns an unmodifiable collection of all available animations.
|
java.util.Set<java.lang.String> |
getAnimClipsNames()
Returns an unmodifiable set of all available animation names.
|
Action |
getCurrentAction()
Return the current action on the default layer.
|
Action |
getCurrentAction(java.lang.String layerName)
Return current action on specified layer.
|
float |
getGlobalSpeed()
Determine the global speed applied to all layers.
|
double |
getTime()
Returns current time of the default layer.
|
double |
getTime(java.lang.String layerName)
Returns current time of the specified layer.
|
boolean |
hasAction(java.lang.String name)
Tells if an action is contained in the list of actions.
|
boolean |
hasAnimClip(java.lang.String name)
Tells if an animation is contained in the list of animations.
|
java.lang.Object |
jmeClone()
Create a shallow clone for the JME cloner.
|
Action |
makeAction(java.lang.String name)
Create a new ClipAction with specified clip name.
|
void |
makeLayer(java.lang.String name,
AnimationMask mask)
Add a layer to this composer.
|
void |
read(JmeImporter im)
De-serialize this composer from the specified importer, for example when
loading from a J3O file.
|
Action |
removeAction(java.lang.String name)
Remove specified action.
|
void |
removeAnimClip(AnimClip anim)
Remove an animation so that it is no longer available for playing.
|
void |
removeCurrentAction()
Remove current action on default layer.
|
void |
removeCurrentAction(java.lang.String layerName)
Remove current action on specified layer.
|
void |
removeLayer(java.lang.String name)
Remove specified layer.
|
void |
reset()
Reset all layers to t=0 with no current action.
|
Action |
setCurrentAction(java.lang.String name)
Run an action on the default layer.
|
Action |
setCurrentAction(java.lang.String actionName,
java.lang.String layerName)
Run an action on specified layer.
|
void |
setGlobalSpeed(float globalSpeed)
Alter the global speed applied to all layers.
|
void |
setTime(double time)
Sets current time on the default layer.
|
void |
setTime(java.lang.String layerName,
double time)
Sets current time on the specified layer.
|
void |
write(JmeExporter ex)
Serialize this composer to the specified exporter, for example when
saving to a J3O file.
|
cloneForSpatial, getSpatial, isEnabled, render, setEnabled, setSpatial, update
public static final java.lang.String DEFAULT_LAYER
public AnimComposer()
public boolean hasAnimClip(java.lang.String name)
name
- The name of the animation.public AnimClip getAnimClip(java.lang.String name)
name
- The name of the animation to retrieve.public void addAnimClip(AnimClip anim)
AnimControl
.anim
- The animation to add.public void removeAnimClip(AnimClip anim)
anim
- The animation to remove.public Action setCurrentAction(java.lang.String name)
name
- The name of the action to run.public Action setCurrentAction(java.lang.String actionName, java.lang.String layerName)
actionName
- The name of the action to run.layerName
- The layer on which action should run.public Action getCurrentAction()
public Action getCurrentAction(java.lang.String layerName)
layerName
- The layer on which action should run.public void removeCurrentAction()
public void removeCurrentAction(java.lang.String layerName)
layerName
- The name of the layer we want to remove its action.public double getTime()
public double getTime(java.lang.String layerName)
layerName
- The layer from which to get the time.public void setTime(double time)
time
- the desired time (in seconds)public void setTime(java.lang.String layerName, double time)
layerName
- the name of the Layer to modifytime
- the desired time (in seconds)public Action action(java.lang.String name)
name
- The name of the action to return.makeAction(java.lang.String)
public Action getAction(java.lang.String name)
name
- The name of the action to return.public void addAction(java.lang.String name, Action action)
name
- The name of the action.action
- The action to add.public Action makeAction(java.lang.String name)
name
- The name of the clip.java.lang.IllegalArgumentException
- if clip with specified name not found.public boolean hasAction(java.lang.String name)
name
- The name of the action.public Action removeAction(java.lang.String name)
name
- The name of the action to remove.public void makeLayer(java.lang.String name, AnimationMask mask)
name
- the desired name for the new layermask
- the desired mask for the new layer (alias created)public void removeLayer(java.lang.String name)
name
- The name of the layer to remove.public BaseAction actionSequence(java.lang.String name, Tween... tweens)
name
- a name for the new Actiontweens
- the desired sequence of tweenspublic BlendAction actionBlended(java.lang.String name, BlendSpace blendSpace, java.lang.String... clips)
name
- a name for the new ActionblendSpace
- how to blend the clips (not null, alias created)clips
- the names of the clips to be used (not null)public void reset()
public java.util.Collection<AnimClip> getAnimClips()
public java.util.Set<java.lang.String> getAnimClipsNames()
protected void controlUpdate(float tpf)
controlUpdate
in class AbstractControl
tpf
- time per frame (in seconds)protected void controlRender(RenderManager rm, ViewPort vp)
controlRender
in class AbstractControl
rm
- the RenderManager rendering the controlled Spatial (not null)vp
- the ViewPort being rendered (not null)public float getGlobalSpeed()
public void setGlobalSpeed(float globalSpeed)
globalSpeed
- the desired speed factor (1=normal speed, default=1)public java.lang.Object jmeClone()
jmeClone
in interface JmeCloneable
jmeClone
in class AbstractControl
public void cloneFields(Cloner cloner, java.lang.Object original)
Cloner
to convert this
shallow-cloned composer into a deep-cloned one, using the specified
Cloner and original to resolve copied fields.cloneFields
in interface JmeCloneable
cloneFields
in class AbstractControl
cloner
- the Cloner that's cloning this composer (not null)original
- the instance from which this composer was shallow-cloned
(not null, unaffected)public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class AbstractControl
im
- the importer to use (not null)java.io.IOException
- from the importerpublic void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class AbstractControl
ex
- the exporter to use (not null)java.io.IOException
- from the exporter