com.jme3.animation
Class BoneTrack

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

public final class BoneTrack
extends java.lang.Object
implements Track

Contains a list of transforms and times for each keyframe.


Constructor Summary
BoneTrack()
          Serialization-only.
BoneTrack(int targetBoneIndex)
          Creates a bone track for the given bone index
BoneTrack(int targetBoneIndex, float[] times, Vector3f[] translations, Quaternion[] rotations)
          Creates a bone track for the given bone index
BoneTrack(int targetBoneIndex, float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales)
          Creates a bone track for the given bone index
 
Method Summary
 BoneTrack clone()
          This method creates a clone of the current object.
 float getLength()
           
 Quaternion[] getRotations()
          return the array of rotations of this track
 Vector3f[] getScales()
          returns the array of scales for this track
 int getTargetBoneIndex()
           
 float[] getTimes()
          returns the arrays of time for this track
 Vector3f[] getTranslations()
          returns the array of translations of this track
 void read(JmeImporter im)
           
 void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] rotations)
          Set the translations and rotations for this bone track
 void setKeyframes(float[] times, Vector3f[] translations, Quaternion[] rotations, Vector3f[] scales)
          Set the translations, rotations and scales for this bone track
 void setTime(float time, float weight, AnimControl control, AnimChannel channel)
           
 void setTime(float time, float weight, AnimControl control, AnimChannel channel, TempVars vars)
          Modify the bone which this track modifies in the skeleton to contain the correct animation transforms for a given time.
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoneTrack

public BoneTrack()
Serialization-only. Do not use.


BoneTrack

public BoneTrack(int targetBoneIndex,
                 float[] times,
                 Vector3f[] translations,
                 Quaternion[] rotations)
Creates a bone track for the given bone index

Parameters:
targetBoneIndex - the bone index
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

BoneTrack

public BoneTrack(int targetBoneIndex,
                 float[] times,
                 Vector3f[] translations,
                 Quaternion[] rotations,
                 Vector3f[] scales)
Creates a bone track for the given bone index

Parameters:
targetBoneIndex - the bone index
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

BoneTrack

public BoneTrack(int targetBoneIndex)
Creates a bone track for the given bone index

Parameters:
targetBoneIndex - the bone's index
Method Detail

getTargetBoneIndex

public int getTargetBoneIndex()
Returns:
the bone index of this bone track.

getRotations

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

Returns:

getScales

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

Returns:

getTimes

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

Returns:

getTranslations

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

Returns:

setKeyframes

public void setKeyframes(float[] times,
                         Vector3f[] translations,
                         Quaternion[] rotations)
Set the translations and rotations for this bone 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

setKeyframes

public void setKeyframes(float[] times,
                         Vector3f[] translations,
                         Quaternion[] rotations,
                         Vector3f[] scales)
Set the translations, rotations and scales for this bone 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

setTime

public void setTime(float time,
                    float weight,
                    AnimControl control,
                    AnimChannel channel,
                    TempVars vars)
Modify the bone which this track modifies in the skeleton to contain the correct animation transforms for a given time. The transforms can be interpolated in some method from the keyframes.

Specified by:
setTime in interface Track
Parameters:
time - the current time of the animation
weight - the weight of the animation
control -
channel -
vars -

getLength

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

clone

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

setTime

public void setTime(float time,
                    float weight,
                    AnimControl control,
                    AnimChannel channel)