Hi folks, I’m trying to determine the best way to loadup a new ‘map’ into my game.
Here is what I’m currently doing:
[java]
stateManager.detach(bulletAppState);
rootNode.detachAllChildren();
bulletAppState = new BulletAppState();
bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
stateManager.attach(bulletAppState);
[/java]
My question is…is this enough? i.e.
will the above actions:
- remove previously loaded assets (assuming I have no other objects referencing those assets?)
- remove PhysicsControls from the physics Space? or do these need to be removed manually? (I’m guessing manually)
- I’m Using nifty…after the above actions, nifty no longer appears to function at all
note: Nifty is setup initially using the following sequence (this sequence is NOT re-executed when loading up the new map)
[java]
if (niftyEnabled) {
// UI - Callback Class
startScreen = new StartScreen();
stateManager.attach(startScreen);
niftyDisplay = new NiftyJmeDisplay(
assetManager,
inputManager,
audioRenderer,
guiViewPort);
Nifty nifty = niftyDisplay.getNifty();
guiViewPort.addProcessor(niftyDisplay);
nifty.fromXml(“Interface/gui.xml”, “start”, startScreen);
// needed for nifty?
flyCam.setDragToRotate(true);
}
[/java]
I figure nifty should still functional after the above tear-down, since its not directly attached to the schene graph?
or am I missing something here…I’m guessing I am…but…