Animation Track interface: add getKeyFrameTimes() method

This commit is contained in:
shadowislord 2015-02-22 12:49:31 -05:00
parent d281920e60
commit c5359c7359
6 changed files with 36 additions and 0 deletions

View File

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

View File

@ -257,6 +257,11 @@ public final class BoneTrack implements Track {
return times == null ? 0 : times[times.length - 1] - times[0]; 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. * This method creates a clone of the current object.
* @return a clone of the current object * @return a clone of the current object

View File

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

View File

@ -165,6 +165,11 @@ public final class PoseTrack implements Track {
return times == null ? 0 : times[times.length - 1] - times[0]; 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. * This method creates a clone of the current object.
* @return a clone of the current object * @return a clone of the current object

View File

@ -236,6 +236,11 @@ public class SpatialTrack implements Track {
return times == null ? 0 : times[times.length - 1] - times[0]; 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. * This method creates a clone of the current object.
* @return a clone of the current object * @return a clone of the current object

View File

@ -60,4 +60,15 @@ public interface Track extends Savable, Cloneable {
* @return a clone of the current object * @return a clone of the current object
*/ */
public Track clone(); 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();
} }