From 9b6bd1fdc413e1cfe57d5d1009651b3201bf1595 Mon Sep 17 00:00:00 2001 From: "Zer..om" Date: Thu, 6 Jun 2013 18:11:27 +0000 Subject: [PATCH] Fixed a bug where attempting to collide with an empty mesh (0 vertices) would throw an exception rather than returning 0 results. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10643 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/scene/Mesh.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/core/com/jme3/scene/Mesh.java b/engine/src/core/com/jme3/scene/Mesh.java index 1f2c03d3c..7076b7fdc 100644 --- a/engine/src/core/com/jme3/scene/Mesh.java +++ b/engine/src/core/com/jme3/scene/Mesh.java @@ -896,6 +896,10 @@ public class Mesh implements Savable, Cloneable { BoundingVolume worldBound, CollisionResults results){ + if (getVertexCount() == 0) { + return 0; + } + if (collisionTree == null){ createCollisionData(); }