Class 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
  • Constructor Details

    • AnimControl

      public AnimControl(Skeleton skeleton)
      Deprecated.
      Creates a new animation control for the given skeleton. The method setAnimations(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

      public Object 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 interface JmeCloneable
      Overrides:
      jmeClone in class AbstractControl
      Returns:
      a new instance
    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      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 interface JmeCloneable
      Overrides:
      cloneFields in class AbstractControl
      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

      public void setAnimations(HashMap<String,Animation> animations)
      Deprecated.
      Parameters:
      animations - Set the animations that this AnimControl will be capable of playing. The animations should be compatible with the skeleton given in the constructor.
    • getAnim

      public Animation getAnim(String name)
      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

      public void addAnim(Animation anim)
      Deprecated.
      Adds an animation to be available for playing to this AnimControl.
      Parameters:
      anim - The animation to add.
    • removeAnim

      public void removeAnim(Animation anim)
      Deprecated.
      Remove an animation so that it is no longer available for playing.
      Parameters:
      anim - The animation to remove.
    • createChannel

      public AnimChannel 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

      public AnimChannel getChannel(int index)
      Deprecated.
      Return the animation channel at the given index.
      Parameters:
      index - The index, starting at 0, to retrieve the AnimChannel.
      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

      public Skeleton getSkeleton()
      Deprecated.
      Returns:
      The skeleton of this AnimControl.
    • addListener

      public void addListener(AnimEventListener listener)
      Deprecated.
      Adds a new listener to receive animation related events.
      Parameters:
      listener - The listener to add.
    • removeListener

      public void removeListener(AnimEventListener listener)
      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 this AnimControl
      See Also:
    • setSpatial

      public void setSpatial(Spatial spatial)
      Deprecated.
      Internal use only.
      Specified by:
      setSpatial in interface Control
      Overrides:
      setSpatial in class AbstractControl
      Parameters:
      spatial - the spatial to be controlled. This should not be called from user code.
    • getAnimationNames

      public Collection<String> getAnimationNames()
      Deprecated.
      Returns:
      The names of all animations that this AnimControl can play.
    • getAnimationLength

      public float getAnimationLength(String name)
      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 class AbstractControl
      Parameters:
      tpf - time per frame (in seconds)
    • controlRender

      protected void controlRender(RenderManager rm, ViewPort vp)
      Deprecated.
      Internal use only.
      Specified by:
      controlRender in class AbstractControl
      Parameters:
      rm - the RenderManager rendering the controlled Spatial (not null)
      vp - the ViewPort being rendered (not null)
    • write

      public void write(JmeExporter ex) throws IOException
      Deprecated.
      Specified by:
      write in interface Savable
      Overrides:
      write in class AbstractControl
      Throws:
      IOException
    • read

      public void read(JmeImporter im) throws IOException
      Deprecated.
      Specified by:
      read in interface Savable
      Overrides:
      read in class AbstractControl
      Throws:
      IOException