From 4e98d0e13d1f95b58aa2d950c4963c2eb52ef469 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Wed, 1 Jan 2014 20:29:36 +0000 Subject: [PATCH] Added a method to clear collision data. This is often necessary when modifying the mesh in some way. Previously, the only other option was to force creation of the collision data for every change but this is wasteful since the collision data does not need to be regenerated until collideWith() is called. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10951 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/scene/Mesh.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/core/com/jme3/scene/Mesh.java b/engine/src/core/com/jme3/scene/Mesh.java index abfed0634..b894450dc 100644 --- a/engine/src/core/com/jme3/scene/Mesh.java +++ b/engine/src/core/com/jme3/scene/Mesh.java @@ -887,6 +887,15 @@ public class Mesh implements Savable, Cloneable { collisionTree = tree; } + /** + * Clears any previously generated collision data. Use this if + * the mesh has changed in some way that invalidates any previously + * generated BIHTree. + */ + public void clearCollisionData() { + collisionTree = null; + } + /** * Handles collision detection, internal use only. * User code should only use collideWith() on scene