|
|
@ -36,8 +36,15 @@ public class TrackData { |
|
|
|
List<KeyFrame> keyFrames = new ArrayList<>(); |
|
|
|
List<KeyFrame> keyFrames = new ArrayList<>(); |
|
|
|
TimeData timeData = timeArrays.get(0); |
|
|
|
TimeData timeData = timeArrays.get(0); |
|
|
|
Type type = timeData.type; |
|
|
|
Type type = timeData.type; |
|
|
|
|
|
|
|
float lastTime = -1f; |
|
|
|
for (int i = 0; i < timeData.times.length; i++) { |
|
|
|
for (int i = 0; i < timeData.times.length; i++) { |
|
|
|
float time = timeData.times[i]; |
|
|
|
float time = timeData.times[i]; |
|
|
|
|
|
|
|
//avoid some double keyframes that can have bad effects on interpolation
|
|
|
|
|
|
|
|
if (Float.floatToIntBits(time) == Float.floatToIntBits(lastTime)) { |
|
|
|
|
|
|
|
lastTime = time; |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
lastTime = time; |
|
|
|
KeyFrame keyFrame = new KeyFrame(); |
|
|
|
KeyFrame keyFrame = new KeyFrame(); |
|
|
|
keyFrame.time = time; |
|
|
|
keyFrame.time = time; |
|
|
|
setKeyFrameTransforms(type, keyFrame, timeData.times); |
|
|
|
setKeyFrameTransforms(type, keyFrame, timeData.times); |
|
|
|