removed physics error from TerrainGrid tests

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9977 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
bre..om 12 years ago
parent 3a2d25ce30
commit c7d42dede5
  1. 6
      engine/src/test/jme3test/terrain/TerrainGridAlphaMapTest.java
  2. 6
      engine/src/test/jme3test/terrain/TerrainGridSerializationTest.java
  3. 6
      engine/src/test/jme3test/terrain/TerrainGridTest.java
  4. 6
      engine/src/test/jme3test/terrain/TerrainGridTileLoaderTest.java

@ -202,8 +202,10 @@ public class TerrainGridAlphaMapTest extends SimpleApplication {
public void tileDetached(Vector3f cell, TerrainQuad quad) { public void tileDetached(Vector3f cell, TerrainQuad quad) {
if (usePhysics) { if (usePhysics) {
bulletAppState.getPhysicsSpace().remove(quad); if (quad.getControl(RigidBodyControl.class) != null) {
quad.removeControl(RigidBodyControl.class); bulletAppState.getPhysicsSpace().remove(quad);
quad.removeControl(RigidBodyControl.class);
}
} }
updateMarkerElevations(); updateMarkerElevations();
} }

@ -88,8 +88,10 @@ public class TerrainGridSerializationTest extends SimpleApplication {
} }
public void tileDetached(Vector3f cell, TerrainQuad quad) { public void tileDetached(Vector3f cell, TerrainQuad quad) {
bulletAppState.getPhysicsSpace().remove(quad); if (quad.getControl(RigidBodyControl.class) != null) {
quad.removeControl(RigidBodyControl.class); bulletAppState.getPhysicsSpace().remove(quad);
quad.removeControl(RigidBodyControl.class);
}
} }
}); });

@ -149,8 +149,10 @@ public class TerrainGridTest extends SimpleApplication {
} }
public void tileDetached(Vector3f cell, TerrainQuad quad) { public void tileDetached(Vector3f cell, TerrainQuad quad) {
bulletAppState.getPhysicsSpace().remove(quad); if (quad.getControl(RigidBodyControl.class) != null) {
quad.removeControl(RigidBodyControl.class); bulletAppState.getPhysicsSpace().remove(quad);
quad.removeControl(RigidBodyControl.class);
}
} }
}); });

@ -145,8 +145,10 @@ public class TerrainGridTileLoaderTest extends SimpleApplication {
} }
public void tileDetached(Vector3f cell, TerrainQuad quad) { public void tileDetached(Vector3f cell, TerrainQuad quad) {
bulletAppState.getPhysicsSpace().remove(quad); if (quad.getControl(RigidBodyControl.class) != null) {
quad.removeControl(RigidBodyControl.class); bulletAppState.getPhysicsSpace().remove(quad);
quad.removeControl(RigidBodyControl.class);
}
} }
}); });

Loading…
Cancel
Save