Package com.jme3.anim

Class AnimClip

java.lang.Object
com.jme3.anim.AnimClip
All Implemented Interfaces:
Savable, JmeCloneable, Cloneable

public class AnimClip extends Object implements JmeCloneable, Savable
A named set of animation tracks that can be played in synchrony. Created by Nehon on 20/12/2017.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    No-argument constructor needed by SavableClassUtil.
     
    Instantiate a zero-length clip with the specified name.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cloneFields(Cloner cloner, Object original)
    Callback from Cloner to convert this shallow-cloned clip into a deep-cloned one, using the specified Cloner and original to resolve copied fields.
    double
    Determine the duration of this clip.
    Determine the name of this clip.
    Access all the tracks in this clip.
    Create a shallow clone for the JME cloner.
    void
    De-serialize this clip from the specified importer, for example when loading from a J3O file.
    void
    setTracks(AnimTrack[] tracks)
    Replace all tracks in this clip.
    Represent this clip as a String.
    void
    Serialize this clip to the specified exporter, for example when saving to a J3O file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AnimClip

      protected AnimClip()
      No-argument constructor needed by SavableClassUtil.
    • AnimClip

      public AnimClip(String name)
      Instantiate a zero-length clip with the specified name.
      Parameters:
      name - desired name for the new clip
  • Method Details

    • setTracks

      public void setTracks(AnimTrack[] tracks)
      Replace all tracks in this clip. This method may increase the clip's length, but it will never reduce it.
      Parameters:
      tracks - the tracks to use (alias created)
    • getName

      public String getName()
      Determine the name of this clip.
      Returns:
      the name
    • getLength

      public double getLength()
      Determine the duration of this clip.
      Returns:
      the duration (in seconds)
    • getTracks

      public AnimTrack[] getTracks()
      Access all the tracks in this clip.
      Returns:
      the pre-existing array
    • jmeClone

      public Object jmeClone()
      Create a shallow clone for the JME cloner.
      Specified by:
      jmeClone in interface JmeCloneable
      Returns:
      a new instance
    • cloneFields

      public void cloneFields(Cloner cloner, Object original)
      Callback from Cloner to convert this shallow-cloned clip into a deep-cloned one, using the specified Cloner and original to resolve copied fields.
      Specified by:
      cloneFields in interface JmeCloneable
      Parameters:
      cloner - the Cloner that's cloning this clip (not null)
      original - the instance from which this clip was shallow-cloned (not null, unaffected)
    • toString

      public String toString()
      Represent this clip as a String.
      Overrides:
      toString in class Object
      Returns:
      a descriptive string of text (not null, not empty)
    • write

      public void write(JmeExporter ex) throws IOException
      Serialize this clip to the specified exporter, for example when saving to a J3O file.
      Specified by:
      write in interface Savable
      Parameters:
      ex - the exporter to write to (not null)
      Throws:
      IOException - from the exporter
    • read

      public void read(JmeImporter im) throws IOException
      De-serialize this clip from the specified importer, for example when loading from a J3O file.
      Specified by:
      read in interface Savable
      Parameters:
      im - the importer to read from (not null)
      Throws:
      IOException - from the importer