From 03b351f26c686f2be3cd06aa14ae8cb75bf0d268 Mon Sep 17 00:00:00 2001 From: Alrik Date: Tue, 1 Mar 2016 22:58:43 +0100 Subject: [PATCH 1/4] - fix Bone constructor doesn't clone the given Bone object parameter --- jme3-core/src/main/java/com/jme3/animation/Bone.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/animation/Bone.java b/jme3-core/src/main/java/com/jme3/animation/Bone.java index 29c0f38e9..80d03b374 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Bone.java +++ b/jme3-core/src/main/java/com/jme3/animation/Bone.java @@ -155,13 +155,13 @@ public final class Bone implements Savable { userControl = source.userControl; - bindPos = source.bindPos; - bindRot = source.bindRot; - bindScale = source.bindScale; + bindPos = source.bindPos.clone(); + bindRot = source.bindRot.clone(); + bindScale = source.bindScale.clone(); - modelBindInversePos = source.modelBindInversePos; - modelBindInverseRot = source.modelBindInverseRot; - modelBindInverseScale = source.modelBindInverseScale; + modelBindInversePos = source.modelBindInversePos.clone(); + modelBindInverseRot = source.modelBindInverseRot.clone(); + modelBindInverseScale = source.modelBindInverseScale.clone(); // parent and children will be assigned manually.. } From 54d563dde23f41c21f4bcd252357996bbea99470 Mon Sep 17 00:00:00 2001 From: Alrik Date: Wed, 2 Mar 2016 21:32:04 +0100 Subject: [PATCH 2/4] - remove unnecessary comment --- jme3-core/src/main/java/com/jme3/animation/Bone.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/animation/Bone.java b/jme3-core/src/main/java/com/jme3/animation/Bone.java index 80d03b374..37a95ed5c 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Bone.java +++ b/jme3-core/src/main/java/com/jme3/animation/Bone.java @@ -141,10 +141,6 @@ public final class Bone implements Savable { *

* Only copies the name and bind pose from the original. *

- * WARNING: Local bind pose and world inverse bind pose transforms shallow - * copied. Modifying that data on the original bone will cause it to - * be recomputed on any cloned bones. - *

* The rest of the data is NOT copied, as it will be * generated automatically when the bone is animated. * From 546850130d6b08084f4836da8f70981b8bd5df03 Mon Sep 17 00:00:00 2001 From: Alrik Date: Wed, 2 Mar 2016 21:43:45 +0100 Subject: [PATCH 3/4] - make the comment more precise because user control and world inverse / local bind pose transforms are also copied --- jme3-core/src/main/java/com/jme3/animation/Bone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/animation/Bone.java b/jme3-core/src/main/java/com/jme3/animation/Bone.java index 37a95ed5c..55cd8fccd 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Bone.java +++ b/jme3-core/src/main/java/com/jme3/animation/Bone.java @@ -139,7 +139,7 @@ public final class Bone implements Savable { /** * Special-purpose copy constructor. *

- * Only copies the name and bind pose from the original. + * Only copies the name, user control state and world inverse / local bind pose transforms from the original. *

* The rest of the data is NOT copied, as it will be * generated automatically when the bone is animated. From f925e3eb81b1c9d6cc4f884e5fdb27c72b6b1457 Mon Sep 17 00:00:00 2001 From: Alrik Date: Wed, 2 Mar 2016 21:44:51 +0100 Subject: [PATCH 4/4] - revert mistake --- jme3-core/src/main/java/com/jme3/animation/Bone.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/animation/Bone.java b/jme3-core/src/main/java/com/jme3/animation/Bone.java index 55cd8fccd..fcbacb337 100644 --- a/jme3-core/src/main/java/com/jme3/animation/Bone.java +++ b/jme3-core/src/main/java/com/jme3/animation/Bone.java @@ -139,7 +139,7 @@ public final class Bone implements Savable { /** * Special-purpose copy constructor. *

- * Only copies the name, user control state and world inverse / local bind pose transforms from the original. + * Only copies the name, user control state and bind pose transforms from the original. *

* The rest of the data is NOT copied, as it will be * generated automatically when the bone is animated.