GuiObjectManager now allows users to set Keyframes for Transformations

Fixed a bug in KeyframeList#getClosestKeyframeForTimestamp that made it only work with AdvancedPosition Keyframes
This commit is contained in:
CrushedPixel
2015-07-11 14:26:43 +02:00
parent 3fb0d87824
commit 28f7d77800
5 changed files with 184 additions and 33 deletions

View File

@@ -1,6 +1,5 @@
package eu.crushedpixel.replaymod.interpolation;
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
import eu.crushedpixel.replaymod.holders.Keyframe;
import eu.crushedpixel.replaymod.holders.KeyframeComparator;
@@ -108,7 +107,6 @@ public class KeyframeList<K extends KeyframeValue> extends ArrayList<Keyframe<K>
public Keyframe<K> getClosestKeyframeForTimestamp(int realTime, int tolerance) {
List<Keyframe<K>> found = new ArrayList<Keyframe<K>>();
for(Keyframe<K> kf : this) {
if(!(kf.getValue() instanceof AdvancedPosition)) continue;
if(Math.abs(kf.getRealTimestamp() - realTime) <= tolerance) {
found.add(kf);
}