@Override
    public void cleanup() {
        if (isVr()) {
            VRAppState vrAppState = app.getStateManager().getState(VRAppState.ID, VRAppState.class);
            vrAppState.getLeftViewPort().detachScene(physicsDebugRootNode);
            vrAppState.getRightViewPort().detachScene(physicsDebugRootNode);
        } else {
            rm.removeMainView(viewPort);
        }

        super.cleanup();
    }
Transition this state from terminating to detached. Should be invoked
only by a subclass or by the AppStateManager. Invoked once for each time
{@link #initialize(com.jme3.app.state.AppStateManager, com.jme3.app.Application)}
is invoked.
jme3-jbullet/src/main/java/com/jme3/bullet/debug/BulletDebugAppState.java