com.jme3.animation
Class SpatialTrack

java.lang.Object
  extended by com.jme3.animation.SpatialTrack
All Implemented Interfaces:
Track, Savable, java.lang.Cloneable

public class SpatialTrack
extends java.lang.Object
implements Track

This class represents the track for spatial animation.


Constructor Summary
SpatialTrack()
           
SpatialTrack(float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales)
          Creates a spatial track for the given track data.
 
Method Summary
 SpatialTrack clone()
          This method creates a clone of the current object.
 float getLength()
           
 Quaternion[] getRotations()
           
 Vector3f[] getScales()
           
 float[] getTimes()
           
 Vector3f[] getTranslations()
           
 void read(JmeImporter im)
           
 void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales)
          Set the translations, rotations and scales for this track.
 void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars)
          Modify the spatial which this track modifies.
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpatialTrack

public SpatialTrack()

SpatialTrack

public SpatialTrack(float[] times,
                    Vector3f[] translations,
                    Quaternion[] rotations,
                    Vector3f[] scales)
Creates a spatial track for the given track data.

Parameters:
times - a float array with the time of each frame
translations - the translation of the bone for each frame
rotations - the rotation of the bone for each frame
scales - the scale of the bone for each frame
Method Detail

setTime

public void setTime(float time,
                    float weight,
                    AnimControl control,
                    AnimChannel channel,
                    TempVars vars)
Modify the spatial which this track modifies.

Specified by:
setTime in interface Track
Parameters:
time - the current time of the animation
weight - The weight from 0 to 1 on how much to apply the track
control - The control which the track should effect
channel - The channel which the track should effect

setKeyframes

public void setKeyframes(float[] times,
                         Vector3f[] translations,
                         Quaternion[] rotations,
                         Vector3f[] scales)
Set the translations, rotations and scales for this track.

Parameters:
times - a float array with the time of each frame
translations - the translation of the bone for each frame
rotations - the rotation of the bone for each frame
scales - the scale of the bone for each frame

getRotations

public Quaternion[] getRotations()
Returns:
the array of rotations of this track

getScales

public Vector3f[] getScales()
Returns:
the array of scales for this track

getTimes

public float[] getTimes()
Returns:
the arrays of time for this track

getTranslations

public Vector3f[] getTranslations()
Returns:
the array of translations of this track

getLength

public float getLength()
Specified by:
getLength in interface Track
Returns:
the length of the track

clone

public SpatialTrack clone()
This method creates a clone of the current object.

Specified by:
clone in interface Track
Overrides:
clone in class java.lang.Object
Returns:
a clone of the current object

write

public void write(JmeExporter ex)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException