From 6520fc5b10c2e2def37f4fa10f5c6d10d6539118 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Wed, 23 Jan 2013 16:54:36 +0000 Subject: [PATCH] Bugfix: fixing a bug that caused negative time values to appear in times[] array in tracks. That caused some animations to behave oddly when in loop mode. Bug and solution found by Tobias Downer. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10141 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../blender/com/jme3/scene/plugins/blender/animations/Ipo.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java b/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java index 2a85c585c..a969922b6 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/animations/Ipo.java @@ -140,7 +140,6 @@ public class Ipo { if (calculatedTrack == null) { // preparing data for track int framesAmount = stopFrame - startFrame; - float start = (startFrame - 1.0f) / fps; float timeBetweenFrames = 1.0f / fps; float[] times = new float[framesAmount + 1]; @@ -159,7 +158,7 @@ public class Ipo { // calculating track data for (int frame = startFrame; frame <= stopFrame; ++frame) { int index = frame - startFrame; - times[index] = start + (frame - 1) * timeBetweenFrames; + times[index] = index * timeBetweenFrames;//start + (frame - 1) * timeBetweenFrames; for (int j = 0; j < bezierCurves.length; ++j) { double value = bezierCurves[j].evaluate(frame, BezierCurve.Y_VALUE); switch (bezierCurves[j].getType()) {