From a499e972ab9ff51308f729facf605dda1f8bd694 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Fri, 27 Dec 2013 18:10:07 +0000 Subject: [PATCH] Bugfix: fixed an issue that was recently introduced with not negating Y-rotation values when Y axis was up. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10946 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/animations/Ipo.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 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 9922a145a..423c87f8c 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 @@ -168,6 +168,9 @@ public class Ipo { translation[0] = (float) value; break; case AC_LOC_Y: + if(fixUpAxis && value != 0) { + value = -value; + } translation[yIndex] = (float) value; break; case AC_LOC_Z: @@ -179,11 +182,10 @@ public class Ipo { objectRotation[0] = (float) value * degreeToRadiansFactor; break; case OB_ROT_Y: - if (fixUpAxis) { - objectRotation[yIndex] = value == 0.0f ? 0 : (float) -value * degreeToRadiansFactor; - } else { - objectRotation[yIndex] = (float) value * degreeToRadiansFactor; + if(fixUpAxis && value != 0) { + value = -value; } + objectRotation[yIndex] = (float) value * degreeToRadiansFactor; break; case OB_ROT_Z: objectRotation[zIndex] = (float) value * degreeToRadiansFactor; @@ -208,10 +210,13 @@ public class Ipo { quaternionRotation[0] = (float) value; break; case AC_QUAT_Y: - quaternionRotation[fixUpAxis ? 1 : 2] = (float) value; + if(fixUpAxis && value != 0) { + value = -value; + } + quaternionRotation[yIndex] = (float)value; break; case AC_QUAT_Z: - quaternionRotation[fixUpAxis ? 2 : 1] = (float) value; + quaternionRotation[zIndex] = (float) value; break; default: LOGGER.log(Level.WARNING, "Unknown ipo curve type: {0}.", bezierCurves[j].getType());