Added meaningful messages to the exceptions.

experimental
Paul Speed 9 years ago
parent d4c94bc7c0
commit a0261e78fb
  1. 11
      jme3-core/src/main/java/com/jme3/collision/bih/BIHTree.java

@ -109,8 +109,11 @@ public class BIHTree implements CollisionData {
this.mesh = mesh; this.mesh = mesh;
this.maxTrisPerNode = maxTrisPerNode; this.maxTrisPerNode = maxTrisPerNode;
if (maxTrisPerNode < 1 || mesh == null) { if (maxTrisPerNode < 1) {
throw new IllegalArgumentException(); throw new IllegalArgumentException("maxTrisPerNode cannot be less than 1");
}
if (mesh == null) {
throw new IllegalArgumentException("Mesh cannot be null");
} }
bihSwapTmp = new float[9]; bihSwapTmp = new float[9];
@ -451,7 +454,7 @@ public class BIHTree implements CollisionData {
} else if (bv instanceof BoundingBox) { } else if (bv instanceof BoundingBox) {
bbox = new BoundingBox((BoundingBox) bv); bbox = new BoundingBox((BoundingBox) bv);
} else { } else {
throw new UnsupportedCollisionException(); throw new UnsupportedCollisionException("BoundingVolume:" + bv);
} }
bbox.transform(worldMatrix.invert(), bbox); bbox.transform(worldMatrix.invert(), bbox);
@ -470,7 +473,7 @@ public class BIHTree implements CollisionData {
BoundingVolume bv = (BoundingVolume) other; BoundingVolume bv = (BoundingVolume) other;
return collideWithBoundingVolume(bv, worldMatrix, results); return collideWithBoundingVolume(bv, worldMatrix, results);
} else { } else {
throw new UnsupportedCollisionException(); throw new UnsupportedCollisionException("Collidable:" + other);
} }
} }

Loading…
Cancel
Save