|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.scene.control.AbstractControl
com.jme3.animation.AnimControl
public final class AnimControl
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
Field Summary |
---|
Fields inherited from class com.jme3.scene.control.AbstractControl |
---|
enabled, spatial |
Constructor Summary | |
---|---|
AnimControl()
Serialization only. |
|
AnimControl(Skeleton skeleton)
Creates a new animation control for the given skeleton. |
Method Summary | |
---|---|
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. |
protected void |
controlRender(RenderManager rm,
ViewPort vp)
Internal use only. |
protected void |
controlUpdate(float tpf)
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)
|
Methods inherited from class com.jme3.scene.control.AbstractControl |
---|
getSpatial, isEnabled, render, setEnabled, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnimControl(Skeleton skeleton)
setAnimations(java.util.HashMap)
must be called after initialization in order for this class to be useful.
skeleton
- The skeleton to animatepublic AnimControl()
Method Detail |
---|
public Control cloneForSpatial(Spatial spatial)
cloneForSpatial
in interface Control
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.public Animation getAnim(java.lang.String name)
name
- The name of the animation to retrieve.
public void addAnim(Animation anim)
AnimControl
.
anim
- The animation to add.public void removeAnim(Animation anim)
anim
- The animation to remove.public AnimChannel createChannel()
AnimControl
.public AnimChannel getChannel(int index)
index
- The index, starting at 0, to retrieve the AnimChannel
.
java.lang.IndexOutOfBoundsException
- If no channel exists at the given index.public int getNumChannels()
AnimControl
.createChannel()
public void clearChannels()
createChannel()
public Skeleton getSkeleton()
AnimControl
.public void addListener(AnimEventListener listener)
listener
- The listener to add.public void removeListener(AnimEventListener listener)
listener
- addListener(com.jme3.animation.AnimEventListener)
public void clearListeners()
AnimControl
addListener(com.jme3.animation.AnimEventListener)
public void setSpatial(Spatial spatial)
setSpatial
in interface Control
setSpatial
in class AbstractControl
spatial
- the spatial to be controlled. This should not be called
from user code.public java.util.Collection<java.lang.String> getAnimationNames()
AnimControl
can play.public float getAnimationLength(java.lang.String name)
name
- The name of the animation
protected void controlUpdate(float tpf)
controlUpdate
in class AbstractControl
protected void controlRender(RenderManager rm, ViewPort vp)
controlRender
in class AbstractControl
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
write
in class AbstractControl
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
read
in class AbstractControl
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |