@SuppressWarnings("unchecked") @Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); bulletAppState = new BulletAppState(); app.getStateManager().attach(bulletAppState); StaticWorldHelper.addStaticWorld( App.rally.getRootNode(), getPhysicsSpace(), world, App.rally.sky.ifShadow); cb = new CarBuilder(); cb.addCar(getPhysicsSpace(), 0, car, world.start, Matrix3f.IDENTITY, false); camNode = new MyCamera("Cam Node 2", App.rally.getCamera(), null); camNode.setLocalTranslation(0, 3, 7); camNode.lookAt(new Vector3f(0, 1.2f, 0), new Vector3f(0, 1, 0)); Container myWindow = new Container(); App.rally.getGuiNode().attachChild(myWindow); myWindow.setLocalTranslation(300, 300, 0); // Add some elements to it myWindow.addChild(new Label("Main Menu")); Button startFast = myWindow.addChild(new Button("Start Fast")); startFast.addClickCommands( new Command<Button>() { @Override public void execute(Button source) { startFast(); App.rally.getGuiNode().detachChild(myWindow); } }); Button start = myWindow.addChild(new Button("Start")); start.addClickCommands( new Command<Button>() { @Override public void execute(Button source) { startBasic(); App.rally.getGuiNode().detachChild(myWindow); } }); }
public void cleanup() { StaticWorldHelper.removeStaticWorld(App.rally.getRootNode(), getPhysicsSpace(), world); cb.cleanup(); App.rally.getRootNode().detachChild(camNode); }