Procházet zdrojové kódy

* Fixed yet another bug with transforms, this time in Spatial.worldToLocal

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7296 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
sha..rd před 14 roky
rodič
revize
e6b11e8013
1 změnil soubory, kde provedl 8 přidání a 1 odebrání
  1. 8 1
      engine/src/core/com/jme3/math/Transform.java

+ 8 - 1
engine/src/core/com/jme3/math/Transform.java

@@ -253,8 +253,15 @@ public final class Transform implements Savable, Cloneable {
         if (store == null)
             store = new Vector3f();
 
-        in.subtract(translation, store).divideLocal(scale);
+        // The author of this code should look above and take the inverse of that
+        // But for some reason, they didnt ..
+//        in.subtract(translation, store).divideLocal(scale);
+//        rot.inverse().mult(store, store);
+
+        in.subtract(translation, store);
         rot.inverse().mult(store, store);
+        store.divideLocal(scale);
+
         return store;
     }