From 200801cd4e41a6ea63759377995abcb454e4625e Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 8 Nov 2011 23:21:27 +0000 Subject: [PATCH] SDK: - Fix bug in physics stop button git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8604 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/gde/core/scene/SceneApplication.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java b/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java index 0fd8ec433..46e1825e2 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java @@ -462,7 +462,7 @@ public class SceneApplication extends Application implements LookupProvider, Loo if (physicsState != null) { physicsState.getPhysicsSpace().removeAll(rootNode); getStateManager().detach(physicsState); - physicsState=null; + physicsState = null; } currentSceneRequest.setDisplayed(false); } @@ -569,21 +569,22 @@ public class SceneApplication extends Application implements LookupProvider, Loo } }); } - - public void setPhysicsEnabled(final boolean enabled){ + + public void setPhysicsEnabled(final boolean enabled) { enqueue(new Callable() { public Object call() throws Exception { if (enabled) { - if(physicsState==null){ + if (physicsState == null) { physicsState = new BulletAppState(); getStateManager().attach(physicsState); physicsState.getPhysicsSpace().addAll(rootNode); } - }else{ - if(physicsState!=null){ + } else { + if (physicsState != null) { physicsState.getPhysicsSpace().removeAll(rootNode); getStateManager().detach(physicsState); + physicsState = null; } } return null;