Class EffectTrack

java.lang.Object
com.jme3.animation.EffectTrack
All Implemented Interfaces:
ClonableTrack, Track, Savable, JmeCloneable, Cloneable

@Deprecated public class EffectTrack extends Object implements ClonableTrack
Deprecated.
EffectTrack is a track to add to an existing animation, to emit particles during animations for example: exhaust, dust raised by footsteps, shock waves, lightning, etc... usage is
 AnimControl control model.getControl(AnimControl.class);
 EffectTrack track = new EffectTrack(existingEmitter, control.getAnim("TheAnim").getLength());
 control.getAnim("TheAnim").addTrack(track);
 
if the emitter emits 0 particles per second, emitAllPArticles will be called on it at time 0 + startOffset. if it has more it will start emitting normally at time 0 + startOffset.
  • Constructor Details

    • EffectTrack

      protected EffectTrack()
      Deprecated.
      constructor only for serialization
    • EffectTrack

      public EffectTrack(ParticleEmitter emitter, float length)
      Deprecated.
      Creates and EffectTrack
      Parameters:
      emitter - the emitter of the track
      length - the length of the track (usually the length of the animation you want to add the track to)
    • EffectTrack

      public EffectTrack(ParticleEmitter emitter, float length, float startOffset)
      Deprecated.
      Creates and EffectTrack
      Parameters:
      emitter - the emitter of the track
      length - the length of the track (usually the length of the animation you want to add the track to)
      startOffset - the time in second when the emitter will be triggered after the animation starts (default is 0)
  • Method Details

    • setTime

      public void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars)
      Deprecated.
      Internal use only
      Specified by:
      setTime in interface Track
      Parameters:
      time - The time in the animation
      weight - The weight from 0 to 1 on how much to apply the track
      control - The control which the track should affect
      channel - The channel which the track should affect
      vars - temporary storage
      See Also:
    • getLength

      public float getLength()
      Deprecated.
      Return the length of the track
      Specified by:
      getLength in interface Track
      Returns:
      length of the track
    • getKeyFrameTimes

      public float[] getKeyFrameTimes()
      Deprecated.
      Description copied from interface: Track
      Get the times in seconds for all keyframes. All keyframe times should be between 0.0 and length. Modifying the provided array is not allowed, as it may corrupt internal state.
      Specified by:
      getKeyFrameTimes in interface Track
      Returns:
      the keyframe times
    • clone

      public EffectTrack clone()
      Deprecated.
      Clone this track
      Specified by:
      clone in interface Track
      Overrides:
      clone in class Object
      Returns:
      a new instance
    • cloneForSpatial

      public Track cloneForSpatial(Spatial spatial)
      Deprecated.
      This method clone the Track and search for the cloned counterpart of the original emitter in the given cloned spatial. The spatial is assumed to be the Spatial holding the AnimControl controlling the animation using this Track.
      Specified by:
      cloneForSpatial in interface ClonableTrack
      Parameters:
      spatial - the Spatial holding the AnimControl
      Returns:
      the cloned Track with proper reference
    • 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
      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
      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.
    • cleanUp

      public void cleanUp()
      Deprecated.
      Description copied from interface: ClonableTrack
      Method responsible for cleaning UserData on referenced Spatials when the Track is deleted
      Specified by:
      cleanUp in interface ClonableTrack
    • getEmitter

      public ParticleEmitter getEmitter()
      Deprecated.
      Returns:
      the emitter used by this track
    • setEmitter

      public void setEmitter(ParticleEmitter emitter)
      Deprecated.
      Sets the Emitter to use in this track
      Parameters:
      emitter - the emitter to be controlled (alias created)
    • getStartOffset

      public float getStartOffset()
      Deprecated.
      Returns:
      the start offset of the track
    • setStartOffset

      public void setStartOffset(float startOffset)
      Deprecated.
      set the start offset of the track
      Parameters:
      startOffset - the start offset (in seconds)
    • write

      public void write(JmeExporter ex) throws IOException
      Deprecated.
      Internal use only serialization
      Specified by:
      write in interface Savable
      Parameters:
      ex - exporter
      Throws:
      IOException - exception
    • read

      public void read(JmeImporter im) throws IOException
      Deprecated.
      Internal use only serialization
      Specified by:
      read in interface Savable
      Parameters:
      im - importer
      Throws:
      IOException - Exception