Forráskód Böngészése

Fixed issue exposed in this thread http://hub.jmonkeyengine.org/t/found-bug-in-jme-xmlexporter-vector3f-zero-abuse/31430
Thanks to AXELTOPOLINO

Nehon 10 éve
szülő
commit
4cb007f3b3
1 módosított fájl, 5 hozzáadás és 2 törlés
  1. 5 2
      jme3-core/src/main/java/com/jme3/math/Transform.java

+ 5 - 2
jme3-core/src/main/java/com/jme3/math/Transform.java

@@ -297,8 +297,11 @@ public final class Transform implements Savable, Cloneable, java.io.Serializable
     public void read(JmeImporter e) throws IOException {
         InputCapsule capsule = e.getCapsule(this);
         
-        rot = (Quaternion)capsule.readSavable("rot", new Quaternion());
-        translation = (Vector3f)capsule.readSavable("translation", Vector3f.ZERO);
+        rot = (Quaternion)capsule.readSavable("rot", new Quaternion());        
+        translation = (Vector3f)capsule.readSavable("translation", null);
+        if( translation == null ) {
+            translation = new Vector3f();
+        }
         scale = (Vector3f)capsule.readSavable("scale", Vector3f.UNIT_XYZ);
     }