public class WildMagic extends SimpleApplication {
public Container myWindow;public static void main(String[] args) { WildMagic app = new WildMagic(); app.setShowSettings(false); //Settings dialog not supported on mac app.start(); } @Override public void simpleInitApp() { Level level = new Level(); level.setEnabled(true); } @Override public void simpleUpdate(float tpf) { } @Override public void simpleRender(RenderManager rm) { }
}
public class Level extends BaseAppState implements ActionListener{
private SimpleApplication app;
private Node rootNode;
private AssetManager assetManager;
private AppStateManager stateManager;
private InputManager inputManager;
private ViewPort viewPort;
private BulletAppState physics;
private FlyByCamera flyCam;
private Camera cam;private void setUpLight() {
AmbientLight al = new AmbientLight();
al.setColor(ColorRGBA.White.mult(1.3f));
rootNode.addLight(al);DirectionalLight dl = new DirectionalLight(); dl.setColor(ColorRGBA.White); dl.setDirection(new Vector3f(2.8f, -2.8f, -2.8f).normalizeLocal()); rootNode.addLight(dl);
}
private void setUpKeys() {
}
/** These are our custom actions triggered by key presses.
- We do not walk yet, we just keep track of the direction the user pressed. */
@Override
public void onAction(String binding, boolean value, float tpf) {}
@Override protected void initialize(Application app) { app = (SimpleApplication)app; initialize(app); this.rootNode = this.app.getRootNode(); this.assetManager = this.app.getAssetManager(); this.stateManager = this.app.getStateManager(); this.inputManager = this.app.getInputManager(); this.viewPort = this.app.getViewPort(); this.physics = this.stateManager.getState(BulletAppState.class); this.flyCam = this.app.getFlyByCamera(); this.cam = this.app.getCamera(); setupLight(); assetManager.registerLocator("./assets", FileLocator.class); Spatial object = assetManager.loadModel("models/level/start.glb"); this.app.getRootNode().attachChild(object); object.setLocalTranslation(-1, -1, -1); } private void setupLight() { AmbientLight al = new AmbientLight(); al.setColor(ColorRGBA.White.mult(1.3f)); rootNode.addLight(al); DirectionalLight dl = new DirectionalLight(); dl.setColor(ColorRGBA.White); dl.setDirection(new Vector3f(2.8f, -2.8f, -2.8f).normalizeLocal()); rootNode.addLight(dl); } @Override protected void cleanup(Application aplctn) { } @Override protected void onEnable() { } @Override protected void onDisable() { } @Override public void update(float tpf) { }
}
Level model not load in BaseAppState help please