Class AnimationClip

java.lang.Object
com.ardor3d.extension.animation.skeletal.clip.AnimationClip
All Implemented Interfaces:
Savable

public class AnimationClip extends Object implements Savable
AnimationClip manages a set of animation channels as a single clip entity.
  • Constructor Details

    • AnimationClip

      public AnimationClip(String name)
      Construct a new animation clip with no channels.
      Parameters:
      name - clip's name, should be unique
    • AnimationClip

      public AnimationClip(String name, List<AbstractAnimationChannel> channels)
      Construct a new animation clip, copying in a given list of channels.
      Parameters:
      name - clip's name, should be unique
      channels - a list of channels to shallow copy locally.
  • Method Details

    • getName

      public String getName()
      Returns:
      the referenceable name for this clip. In general, this should be unique.
    • update

      public void update(double clockTime, AnimationClipInstance instance)
      Update an instance of this clip.
      Parameters:
      clockTime - the current local clip time (where 0 == start of clip)
      instance - the instance record to update.
    • addChannel

      public void addChannel(AbstractAnimationChannel channel)
      Add a channel to this clip.
      Parameters:
      channel - the channel to add.
    • findChannelByName

      public AbstractAnimationChannel findChannelByName(String channelName)
      Locate a channel in this clip using its channel name.
      Parameters:
      channelName - the name to match against.
      Returns:
      the first channel with a name matching the given channelName, or null if no matches are found.
    • removeChannel

      public boolean removeChannel(AbstractAnimationChannel channel)
      Remove a given channel from this clip.
      Parameters:
      channel - the channel to remove.
      Returns:
      true if this clip had the given channel and it was removed.
    • getChannels

      public List<AbstractAnimationChannel> getChannels()
      Returns:
      an immutable copy of the channels in this clip.
    • getMaxTimeIndex

      public float getMaxTimeIndex()
      Returns:
      the maximum (local) time value of this clip, as described by the channels it manages.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getClassTag

      public Class<? extends AnimationClip> getClassTag()
      Specified by:
      getClassTag in interface Savable
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Throws:
      IOException
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Throws:
      IOException
    • initSavable

      public static AnimationClip initSavable()