From 4cb007f3b398e25ed1ed30090e81ab93c376ed21 Mon Sep 17 00:00:00 2001 From: Nehon Date: Tue, 10 Feb 2015 00:11:40 +0100 Subject: [PATCH] Fixed issue exposed in this thread http://hub.jmonkeyengine.org/t/found-bug-in-jme-xmlexporter-vector3f-zero-abuse/31430 Thanks to AXELTOPOLINO --- jme3-core/src/main/java/com/jme3/math/Transform.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/math/Transform.java b/jme3-core/src/main/java/com/jme3/math/Transform.java index 72ec73279..79992ed2b 100644 --- a/jme3-core/src/main/java/com/jme3/math/Transform.java +++ b/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); }