diff --git a/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java b/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java index 1440af160..7bb5ca0ce 100644 --- a/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/AudioTrack.java @@ -150,6 +150,11 @@ public class AudioTrack implements ClonableTrack { return length; } + @Override + public float[] getKeyFrameTimes() { + return new float[] { startOffset }; + } + /** * Clone this track * diff --git a/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java b/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java index bf3c2da73..1dd27ba24 100644 --- a/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/BoneTrack.java @@ -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 diff --git a/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java b/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java index 9d6b9b4d2..85674e223 100644 --- a/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/EffectTrack.java @@ -239,6 +239,11 @@ public class EffectTrack implements ClonableTrack { return length; } + @Override + public float[] getKeyFrameTimes() { + return new float[] { startOffset }; + } + /** * Clone this track * diff --git a/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java b/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java index 92c24ce01..73ad14254 100644 --- a/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/PoseTrack.java @@ -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 diff --git a/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java b/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java index ba715b6f8..928ac1f93 100644 --- a/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java +++ b/jme3-core/src/main/java/com/jme3/animation/SpatialTrack.java @@ -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. diff --git a/jme3-core/src/main/java/com/jme3/animation/Track.java b/jme3-core/src/main/java/com/jme3/animation/Track.java index e77d67f14..4eafed06a 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Track.java +++ b/jme3-core/src/main/java/com/jme3/animation/Track.java @@ -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(); }