From a06ce4ebcd124d286ab572a0ea69424adae5e9cb Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sat, 23 Apr 2011 03:05:06 +0000 Subject: [PATCH] * Fixed issue where scene graphs with non-uniform scales would give incorrect result git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7291 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/animation/Bone.java | 4 ---- engine/src/core/com/jme3/math/Transform.java | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/engine/src/core/com/jme3/animation/Bone.java b/engine/src/core/com/jme3/animation/Bone.java index 3c4187993..b46e1276a 100644 --- a/engine/src/core/com/jme3/animation/Bone.java +++ b/engine/src/core/com/jme3/animation/Bone.java @@ -237,7 +237,6 @@ public final class Bone implements Savable { */ public final void updateWorldVectors() { if (parent != null) { - //rotation parent.worldRot.mult(localRot, worldRot); @@ -251,9 +250,6 @@ public final class Bone implements Savable { parent.worldRot.mult(localPos, worldPos); worldPos.multLocal(parent.worldScale); worldPos.addLocal(parent.worldPos); - - - } else { worldRot.set(localRot); worldPos.set(localPos); diff --git a/engine/src/core/com/jme3/math/Transform.java b/engine/src/core/com/jme3/math/Transform.java index d01334f5b..2d50fe6b1 100644 --- a/engine/src/core/com/jme3/math/Transform.java +++ b/engine/src/core/com/jme3/math/Transform.java @@ -200,11 +200,18 @@ public final class Transform implements Savable, Cloneable { scale.multLocal(parent.scale); // rot.multLocal(parent.rot); parent.rot.mult(rot, rot); - + + // This here, is evil code +// parent +// .rot +// .multLocal(translation) +// .multLocal(parent.scale) +// .addLocal(parent.translation); + + translation.multLocal(parent.scale); parent .rot .multLocal(translation) - .multLocal(parent.scale) .addLocal(parent.translation); return this; } @@ -262,8 +269,9 @@ public final class Transform implements Savable, Cloneable { @Override public String toString(){ - return getClass().getSimpleName() + "[ "+translation.x + ", "+ translation.y + ", "+translation.z+"]\n"+ - "[ "+rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w + "]"; + return getClass().getSimpleName() + "[ " + translation.x + ", " + translation.y + ", " + translation.z + "]\n" + + "[ " + rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w + "]\n" + + "[ " + scale.x + " , " + scale.y + ", " + scale.z + "]"; } /**