From 50645529052a3d889ddfdaff10f9d833b751106a Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Thu, 21 Jan 2016 15:35:20 +0100 Subject: [PATCH 1/2] Fixes #373 - Faulty Loggings of a SphereCollissionShape when using native bullet --- .../com/jme3/bullet/collision/shapes/SphereCollisionShape.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java index e5215506f..d12cfe0ac 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java @@ -91,7 +91,7 @@ public class SphereCollisionShape extends CollisionShape { // new SphereShape(radius); // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); - setScale(scale); + super.setScale(scale); // Set the scale to 1 setMargin(margin); } From e776967c2361ccc3c35c64f61c4130df8bab6588 Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Tue, 26 Jan 2016 15:53:53 +0100 Subject: [PATCH 2/2] Reverted Changes and fixed it the way it was done in CapsuleCollissionShape (See Commit f836b26) "SphereCollisionShape: warn about scaling only if its not identity" --- .../jme3/bullet/collision/shapes/SphereCollisionShape.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java index d12cfe0ac..4ba6152c9 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/SphereCollisionShape.java @@ -82,7 +82,9 @@ public class SphereCollisionShape extends CollisionShape { */ @Override public void setScale(Vector3f scale) { - Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "SphereCollisionShape cannot be scaled"); + if (!scale.equals(Vector3f.UNIT_XYZ)) { + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "SphereCollisionShape cannot be scaled"); + } } protected void createShape() { @@ -91,7 +93,7 @@ public class SphereCollisionShape extends CollisionShape { // new SphereShape(radius); // objectId.setLocalScaling(Converter.convert(getScale())); // objectId.setMargin(margin); - super.setScale(scale); // Set the scale to 1 + setScale(scale); // Set the scale to 1 setMargin(margin); }