Package com.jme3.animation
Class AnimControl
java.lang.Object
com.jme3.scene.control.AbstractControl
com.jme3.animation.AnimControl
- All Implemented Interfaces:
Savable
,Control
,JmeCloneable
,Cloneable
@Deprecated
public final class AnimControl
extends AbstractControl
implements Cloneable, JmeCloneable
Deprecated.
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
7) Hardware skinning
8) Attachments
9) Add/remove skins
Planned:
1) Morph/Pose animation-
Field Summary
Fields inherited from class com.jme3.scene.control.AbstractControl
enabled, spatial
-
Constructor Summary
ConstructorDescriptionDeprecated.Instantiate an animation control with no skeleton, suitable only for animations that don't contain any bone tracks.AnimControl
(Skeleton skeleton) Deprecated.Creates a new animation control for the given skeleton. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Adds an animation to be available for playing to thisAnimControl
.void
addListener
(AnimEventListener listener) Deprecated.Adds a new listener to receive animation related events.void
Deprecated.Clears all the channels that were created.void
Deprecated.Clears all the listeners added to thisAnimControl
void
cloneFields
(Cloner cloner, Object original) Deprecated.Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner.protected void
controlRender
(RenderManager rm, ViewPort vp) Deprecated.Internal use only.protected void
controlUpdate
(float tpf) Deprecated.Internal use only.Deprecated.Create a new animation channel, by default assigned to all bones in the skeleton.Deprecated.Retrieve an animation from the list of animations.float
getAnimationLength
(String name) Deprecated.Returns the length of the given named animation.Deprecated.getChannel
(int index) Deprecated.Return the animation channel at the given index.int
Deprecated.Deprecated.jmeClone()
Deprecated.Performs a regular shallow clone of the object.void
read
(JmeImporter im) Deprecated.void
removeAnim
(Animation anim) Deprecated.Remove an animation so that it is no longer available for playing.void
removeListener
(AnimEventListener listener) Deprecated.Removes the given listener from listening to events.void
setAnimations
(HashMap<String, Animation> animations) Deprecated.void
setSpatial
(Spatial spatial) Deprecated.Internal use only.void
write
(JmeExporter ex) Deprecated.Methods inherited from class com.jme3.scene.control.AbstractControl
cloneForSpatial, getSpatial, isEnabled, render, setEnabled, update
-
Constructor Details
-
AnimControl
Deprecated.Creates a new animation control for the given skeleton. The methodsetAnimations(java.util.HashMap)
must be called after initialization in order for this class to be useful.- Parameters:
skeleton
- The skeleton to animate
-
AnimControl
public AnimControl()Deprecated.Instantiate an animation control with no skeleton, suitable only for animations that don't contain any bone tracks. Also used for serialization.
-
-
Method Details
-
jmeClone
Deprecated.Description copied from interface:JmeCloneable
Performs a regular shallow clone of the object. Some fields may also be cloned but generally only if they will never be shared with other objects. (For example, local Vector3fs and so on.)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.
- Specified by:
jmeClone
in interfaceJmeCloneable
- Overrides:
jmeClone
in classAbstractControl
- Returns:
- a new instance
-
cloneFields
Deprecated.Description copied from interface:JmeCloneable
Implemented to perform deep cloning for this object, resolving local cloned references using the specified cloner. The object can call cloner.clone(fieldValue) to deep clone any of its fields.Note: during normal clone operations the original object will not be needed as the clone has already had all of the fields shallow copied.
- Specified by:
cloneFields
in interfaceJmeCloneable
- Overrides:
cloneFields
in classAbstractControl
- Parameters:
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 only clone what it wants.
-
setAnimations
Deprecated.- Parameters:
animations
- Set the animations that thisAnimControl
will be capable of playing. The animations should be compatible with the skeleton given in the constructor.
-
getAnim
Deprecated.Retrieve 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.
-
addAnim
Deprecated.Adds an animation to be available for playing to thisAnimControl
.- Parameters:
anim
- The animation to add.
-
removeAnim
Deprecated.Remove an animation so that it is no longer available for playing.- Parameters:
anim
- The animation to remove.
-
createChannel
Deprecated.Create a new animation channel, by default assigned to all bones in the skeleton.- Returns:
- A new animation channel for this
AnimControl
.
-
getChannel
Deprecated.Return the animation channel at the given index.- Parameters:
index
- The index, starting at 0, to retrieve theAnimChannel
.- Returns:
- The animation channel at the given index, or throws an exception if the index is out of bounds.
- Throws:
IndexOutOfBoundsException
- If no channel exists at the given index.
-
getNumChannels
public int getNumChannels()Deprecated.- Returns:
- The number of channels that are controlled by this
AnimControl
. - See Also:
-
clearChannels
public void clearChannels()Deprecated.Clears all the channels that were created.- See Also:
-
getSkeleton
Deprecated.- Returns:
- The skeleton of this
AnimControl
.
-
addListener
Deprecated.Adds a new listener to receive animation related events.- Parameters:
listener
- The listener to add.
-
removeListener
Deprecated.Removes the given listener from listening to events.- Parameters:
listener
- the listener to remove- See Also:
-
clearListeners
public void clearListeners()Deprecated.Clears all the listeners added to thisAnimControl
-
setSpatial
Deprecated.Internal use only.- Specified by:
setSpatial
in interfaceControl
- Overrides:
setSpatial
in classAbstractControl
- Parameters:
spatial
- the spatial to be controlled. This should not be called from user code.
-
getAnimationNames
Deprecated.- Returns:
- The names of all animations that this
AnimControl
can play.
-
getAnimationLength
Deprecated.Returns the length of the given named animation.- Parameters:
name
- The name of the animation- Returns:
- The length of time, in seconds, of the named animation.
-
controlUpdate
protected void controlUpdate(float tpf) Deprecated.Internal use only.- Specified by:
controlUpdate
in classAbstractControl
- Parameters:
tpf
- time per frame (in seconds)
-
controlRender
Deprecated.Internal use only.- Specified by:
controlRender
in classAbstractControl
- Parameters:
rm
- the RenderManager rendering the controlled Spatial (not null)vp
- the ViewPort being rendered (not null)
-
write
Deprecated.- Specified by:
write
in interfaceSavable
- Overrides:
write
in classAbstractControl
- Throws:
IOException
-
read
Deprecated.- Specified by:
read
in interfaceSavable
- Overrides:
read
in classAbstractControl
- Throws:
IOException
-
AnimComposer