From c7d42dede53ecc5a31c6920e21dc99b99f59b1ad Mon Sep 17 00:00:00 2001 From: "bre..om" Date: Thu, 8 Nov 2012 23:02:47 +0000 Subject: [PATCH] removed physics error from TerrainGrid tests git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9977 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/test/jme3test/terrain/TerrainGridAlphaMapTest.java | 6 ++++-- .../test/jme3test/terrain/TerrainGridSerializationTest.java | 6 ++++-- engine/src/test/jme3test/terrain/TerrainGridTest.java | 6 ++++-- .../test/jme3test/terrain/TerrainGridTileLoaderTest.java | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/engine/src/test/jme3test/terrain/TerrainGridAlphaMapTest.java b/engine/src/test/jme3test/terrain/TerrainGridAlphaMapTest.java index ecb374932..6a2167bcd 100644 --- a/engine/src/test/jme3test/terrain/TerrainGridAlphaMapTest.java +++ b/engine/src/test/jme3test/terrain/TerrainGridAlphaMapTest.java @@ -202,8 +202,10 @@ public class TerrainGridAlphaMapTest extends SimpleApplication { public void tileDetached(Vector3f cell, TerrainQuad quad) { if (usePhysics) { - bulletAppState.getPhysicsSpace().remove(quad); - quad.removeControl(RigidBodyControl.class); + if (quad.getControl(RigidBodyControl.class) != null) { + bulletAppState.getPhysicsSpace().remove(quad); + quad.removeControl(RigidBodyControl.class); + } } updateMarkerElevations(); } diff --git a/engine/src/test/jme3test/terrain/TerrainGridSerializationTest.java b/engine/src/test/jme3test/terrain/TerrainGridSerializationTest.java index 0960dadf7..27ce15785 100644 --- a/engine/src/test/jme3test/terrain/TerrainGridSerializationTest.java +++ b/engine/src/test/jme3test/terrain/TerrainGridSerializationTest.java @@ -88,8 +88,10 @@ public class TerrainGridSerializationTest extends SimpleApplication { } public void tileDetached(Vector3f cell, TerrainQuad quad) { - bulletAppState.getPhysicsSpace().remove(quad); - quad.removeControl(RigidBodyControl.class); + if (quad.getControl(RigidBodyControl.class) != null) { + bulletAppState.getPhysicsSpace().remove(quad); + quad.removeControl(RigidBodyControl.class); + } } }); diff --git a/engine/src/test/jme3test/terrain/TerrainGridTest.java b/engine/src/test/jme3test/terrain/TerrainGridTest.java index 3b4cb291b..f46455aab 100644 --- a/engine/src/test/jme3test/terrain/TerrainGridTest.java +++ b/engine/src/test/jme3test/terrain/TerrainGridTest.java @@ -149,8 +149,10 @@ public class TerrainGridTest extends SimpleApplication { } public void tileDetached(Vector3f cell, TerrainQuad quad) { - bulletAppState.getPhysicsSpace().remove(quad); - quad.removeControl(RigidBodyControl.class); + if (quad.getControl(RigidBodyControl.class) != null) { + bulletAppState.getPhysicsSpace().remove(quad); + quad.removeControl(RigidBodyControl.class); + } } }); diff --git a/engine/src/test/jme3test/terrain/TerrainGridTileLoaderTest.java b/engine/src/test/jme3test/terrain/TerrainGridTileLoaderTest.java index 821a9971a..96f7f423e 100644 --- a/engine/src/test/jme3test/terrain/TerrainGridTileLoaderTest.java +++ b/engine/src/test/jme3test/terrain/TerrainGridTileLoaderTest.java @@ -145,8 +145,10 @@ public class TerrainGridTileLoaderTest extends SimpleApplication { } public void tileDetached(Vector3f cell, TerrainQuad quad) { - bulletAppState.getPhysicsSpace().remove(quad); - quad.removeControl(RigidBodyControl.class); + if (quad.getControl(RigidBodyControl.class) != null) { + bulletAppState.getPhysicsSpace().remove(quad); + quad.removeControl(RigidBodyControl.class); + } } });