From ac8eb4d40a61c819f316a152da991aeb5837f466 Mon Sep 17 00:00:00 2001 From: Stephen Gold Date: Tue, 17 Jan 2017 11:42:21 -0800 Subject: [PATCH] CapsuleCollisionShape: warn about scaling only if it's not identity same diff riccardobl committed to 'master' on Jun 20, 2016 --- .../bullet/collision/shapes/CylinderCollisionShape.java | 4 +++- .../bullet/collision/shapes/CylinderCollisionShape.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java index 35edb8449..82e60f381 100644 --- a/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java +++ b/jme3-bullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java @@ -86,7 +86,9 @@ public class CylinderCollisionShape extends CollisionShape { */ @Override public void setScale(Vector3f scale) { - Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled"); + if (!scale.equals(Vector3f.UNIT_XYZ)) { + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled"); + } } public void write(JmeExporter ex) throws IOException { diff --git a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java index 1a33c97fe..08a34dad5 100644 --- a/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java +++ b/jme3-jbullet/src/main/java/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java @@ -90,9 +90,11 @@ public class CylinderCollisionShape extends CollisionShape { */ @Override public void setScale(Vector3f scale) { - Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled"); + if (!scale.equals(Vector3f.UNIT_XYZ)) { + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CylinderCollisionShape cannot be scaled"); + } } - + public void write(JmeExporter ex) throws IOException { super.write(ex); OutputCapsule capsule = ex.getCapsule(this);