Browse Source

- issue warning on unscalable collision shapes

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10352 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 12 years ago
parent
commit
12771f839f

+ 9 - 0
engine/src/bullet/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java

@@ -35,6 +35,7 @@ import com.jme3.export.InputCapsule;
 import com.jme3.export.JmeExporter;
 import com.jme3.export.JmeImporter;
 import com.jme3.export.OutputCapsule;
+import com.jme3.math.Vector3f;
 import java.io.IOException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -87,6 +88,14 @@ public class CapsuleCollisionShape extends CollisionShape{
         return axis;
     }
 
+    /**
+     * WARNING - CompoundCollisionShape scaling has no effect.
+     */
+    @Override
+    public void setScale(Vector3f scale) {
+        Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CapsuleCollisionShape cannot be scaled");
+    }
+
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);

+ 8 - 0
engine/src/bullet/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java

@@ -81,6 +81,14 @@ public class CylinderCollisionShape extends CollisionShape {
         return axis;
     }
 
+    /**
+     * WARNING - CompoundCollisionShape scaling has no effect.
+     */
+    @Override
+    public void setScale(Vector3f scale) {
+        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);

+ 9 - 0
engine/src/bullet/com/jme3/bullet/collision/shapes/SphereCollisionShape.java

@@ -35,6 +35,7 @@ import com.jme3.export.InputCapsule;
 import com.jme3.export.JmeExporter;
 import com.jme3.export.JmeImporter;
 import com.jme3.export.OutputCapsule;
+import com.jme3.math.Vector3f;
 import java.io.IOException;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -76,6 +77,14 @@ public class SphereCollisionShape extends CollisionShape {
         createShape();
     }
 
+    /**
+     * WARNING - CompoundCollisionShape scaling has no effect.
+     */
+    @Override
+    public void setScale(Vector3f scale) {
+        Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "SphereCollisionShape cannot be scaled");
+    }
+
     protected void createShape() {
         objectId = createShape(radius);
         Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Created Shape {0}", Long.toHexString(objectId));

+ 11 - 0
engine/src/jbullet/com/jme3/bullet/collision/shapes/CapsuleCollisionShape.java

@@ -39,7 +39,10 @@ import com.jme3.export.InputCapsule;
 import com.jme3.export.JmeExporter;
 import com.jme3.export.JmeImporter;
 import com.jme3.export.OutputCapsule;
+import com.jme3.math.Vector3f;
 import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Basic capsule collision shape
@@ -91,6 +94,14 @@ public class CapsuleCollisionShape extends CollisionShape{
         return axis;
     }
 
+    /**
+     * WARNING - CompoundCollisionShape scaling has no effect.
+     */
+    @Override
+    public void setScale(Vector3f scale) {
+        Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "CapsuleCollisionShape cannot be scaled");
+    }
+
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);

+ 10 - 0
engine/src/jbullet/com/jme3/bullet/collision/shapes/CylinderCollisionShape.java

@@ -41,6 +41,8 @@ import com.jme3.export.JmeImporter;
 import com.jme3.export.OutputCapsule;
 import com.jme3.math.Vector3f;
 import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Basic cylinder collision shape
@@ -83,6 +85,14 @@ public class CylinderCollisionShape extends CollisionShape {
         return axis;
     }
 
+    /**
+     * WARNING - CompoundCollisionShape scaling has no effect.
+     */
+    @Override
+    public void setScale(Vector3f scale) {
+        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);

+ 11 - 0
engine/src/jbullet/com/jme3/bullet/collision/shapes/SphereCollisionShape.java

@@ -37,7 +37,10 @@ import com.jme3.export.InputCapsule;
 import com.jme3.export.JmeExporter;
 import com.jme3.export.JmeImporter;
 import com.jme3.export.OutputCapsule;
+import com.jme3.math.Vector3f;
 import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * Basic sphere collision shape
@@ -63,6 +66,14 @@ public class SphereCollisionShape extends CollisionShape {
         return radius;
     }
 
+    /**
+     * WARNING - CompoundCollisionShape scaling has no effect.
+     */
+    @Override
+    public void setScale(Vector3f scale) {
+        Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "SphereCollisionShape cannot be scaled");
+    }
+
     public void write(JmeExporter ex) throws IOException {
         super.write(ex);
         OutputCapsule capsule = ex.getCapsule(this);