Animation Track interface: add getKeyFrameTimes() method

experimental
shadowislord 10 years ago
parent d281920e60
commit c5359c7359
  1. 5
      jme3-core/src/main/java/com/jme3/animation/AudioTrack.java
  2. 5
      jme3-core/src/main/java/com/jme3/animation/BoneTrack.java
  3. 5
      jme3-core/src/main/java/com/jme3/animation/EffectTrack.java
  4. 5
      jme3-core/src/main/java/com/jme3/animation/PoseTrack.java
  5. 5
      jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java
  6. 11
      jme3-core/src/main/java/com/jme3/animation/Track.java

@ -150,6 +150,11 @@ public class AudioTrack implements ClonableTrack {
return length;
}
@Override
public float[] getKeyFrameTimes() {
return new float[] { startOffset };
}
/**
* Clone this track
*

@ -257,6 +257,11 @@ public final class BoneTrack implements Track {
return times == null ? 0 : times[times.length - 1] - times[0];
}
@Override
public float[] getKeyFrameTimes() {
return times;
}
/**
* This method creates a clone of the current object.
* @return a clone of the current object

@ -239,6 +239,11 @@ public class EffectTrack implements ClonableTrack {
return length;
}
@Override
public float[] getKeyFrameTimes() {
return new float[] { startOffset };
}
/**
* Clone this track
*

@ -165,6 +165,11 @@ public final class PoseTrack implements Track {
return times == null ? 0 : times[times.length - 1] - times[0];
}
@Override
public float[] getKeyFrameTimes() {
return times;
}
/**
* This method creates a clone of the current object.
* @return a clone of the current object

@ -235,6 +235,11 @@ public class SpatialTrack implements Track {
public float getLength() {
return times == null ? 0 : times[times.length - 1] - times[0];
}
@Override
public float[] getKeyFrameTimes() {
return times;
}
/**
* This method creates a clone of the current object.

@ -60,4 +60,15 @@ public interface Track extends Savable, Cloneable {
* @return a clone of the current object
*/
public Track clone();
/**
* Get the times in seconds for all keyframes.
*
* All keyframe times should be between 0.0 and {@link #getLength() length}.
* Modifying the provided array is not allowed, as it may corrupt internal
* state.
*
* @return the keyframe times
*/
public float[] getKeyFrameTimes();
}

Loading…
Cancel
Save