|
|
|
@ -212,15 +212,17 @@ public class BulletAppState implements AppState, PhysicsTickListener { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void update(float tpf) { |
|
|
|
|
if (debugEnabled && debugAppState == null) { |
|
|
|
|
if (debugEnabled && debugAppState == null && pSpace != null) { |
|
|
|
|
debugAppState = new BulletDebugAppState(pSpace); |
|
|
|
|
stateManager.attach(debugAppState); |
|
|
|
|
pSpace.enableDebug(app.getAssetManager()); |
|
|
|
|
} else if (!debugEnabled && debugAppState != null) { |
|
|
|
|
stateManager.detach(debugAppState); |
|
|
|
|
debugAppState = null; |
|
|
|
|
if (pSpace != null) { |
|
|
|
|
pSpace.enableDebug(null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//TODO: remove when deprecation of PhysicsSpace.enableDebug is through
|
|
|
|
|
if (pSpace.getDebugManager() != null && !debugEnabled) { |
|
|
|
|
debugEnabled = true; |
|
|
|
|