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() |
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)
Implemented to perform deep cloning for this object, resolving
local cloned references using the specified cloner.
|
protected void |
controlRender(RenderManager rm,
ViewPort vp)
To be implemented in subclass.
|
protected void |
controlUpdate(float tpf)
To be implemented in subclass.
|
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() |
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()
Performs a regular shallow clone of the object.
|
Action |
makeAction(java.lang.String name)
Create a new ClipAction with specified clip name.
|
void |
makeLayer(java.lang.String name,
AnimationMask mask) |
void |
read(JmeImporter im) |
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() |
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) |
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) |
cloneForSpatial, getSpatial, isEnabled, render, setEnabled, setSpatial, update
public static final java.lang.String DEFAULT_LAYER
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)
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)
AbstractControl
controlUpdate
in class AbstractControl
tpf
- time per frame (in seconds)protected void controlRender(RenderManager rm, ViewPort vp)
AbstractControl
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)
public java.lang.Object jmeClone()
JmeCloneable
This method is separate from the regular clone() method so that objects might still maintain their own regular java clone() semantics (perhaps even using Cloner for those methods). However, because Java's clone() has specific features in the sense of Object's clone() implementation, it's usually best to have some path for subclasses to bypass the public clone() method that might be cloning fields and instead get at the superclass protected clone() methods. For example, through super.jmeClone() or another protected clone method that some base class eventually calls super.clone() in.
jmeClone
in interface JmeCloneable
jmeClone
in class AbstractControl
public void cloneFields(Cloner cloner, java.lang.Object original)
JmeCloneable
Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
cloneFields
in interface JmeCloneable
cloneFields
in class AbstractControl
cloner
- The cloner that is performing the cloning operation. The
cloneFields method can call back into the cloner to make
clones of its subordinate fields.original
- The original object from which this object was cloned.
This is provided for the very rare case that this object needs
to refer to its original for some reason. In general, all of
the relevant values should have been transferred during the
shallow clone and this object need merely clone what it wants.public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class AbstractControl
java.io.IOException
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class AbstractControl
java.io.IOException