@Override public void initialize(AppStateManager stateManager, Application application) { System.out.println("Inititalize " + getClass().getSimpleName()); super.initialize(stateManager, application); this.app = (SimpleApplication) application; this.assetManager = application.getAssetManager(); worldAppState = app.getStateManager().getState(WorldAppState.class); houseAppState = app.getStateManager().getState(HouseAppState.class); bulletAppState = app.getStateManager().getState(BulletAppState.class); SmartPhoneFactory.init(bulletAppState, assetManager, app.getRenderManager(), app.getCamera(), app.getAudioRenderer()); }
@Override public void initialize(AppStateManager stateManager, Application application) { System.out.println("Inititalize " + getClass().getSimpleName()); super.initialize(stateManager, application); this.app = (SimpleApplication) application; this.assetManager = application.getAssetManager(); worldAppState = app.getStateManager().getState(WorldAppState.class); houseAppState = app.getStateManager().getState(HouseAppState.class); bulletAppState = app.getStateManager().getState(BulletAppState.class); devicesAppState = app.getStateManager().getState(DevicesAppState.class); serverManager = new PHATServerManager(); SmartPhoneFactory.init(bulletAppState, assetManager, app.getRenderManager(), app.getCamera(), app.getAudioRenderer()); }
camera = app.getCamera(); camera.setFrustumPerspective(45f, (float) camera.getWidth() / camera.getHeight(), 0.1f, 1000f); app.getCamera().setLocation(new Vector3f(4.497525f, 6.3693237f, 4.173162f)); app.getCamera().setRotation(new Quaternion(0.5199084f, 0.42191547f, -0.32954147f, 0.6656463f)); app.getCamera(), app.getAudioRenderer());
@Override public void init(SimpleApplication app) { AppStateManager stateManager = app.getStateManager(); app.getFlyByCamera().setMoveSpeed(10f); app.getCamera().setLocation(new Vector3f(4.497525f, 6.3693237f, 4.173162f)); app.getCamera().setRotation(new Quaternion(0.5199084f, 0.42191547f, -0.32954147f, 0.6656463f)); BulletAppState bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); //bulletAppState.setDebugEnabled(true); seAPI = SpatialEnvironmentAPI.createSpatialEnvironmentAPI(app); seAPI.getWorldAppState().setCalendar(2013, 1, 1, 12, 0, 0); seAPI.getWorldAppState().setLandType(WorldAppState.LandType.Basic); seAPI.getHouseAppState().runCommand(new CreateHouseCommand("House1", HouseFactory.HouseType.House3room2bath)); devicesAppState = new DevicesAppState(); stateManager.attach(devicesAppState); devicesAppState.runCommand(new CreateSmartphoneCommand("Smartphone1")); devicesAppState.runCommand(new SetDeviceOnFurnitureCommand("Smartphone1", "House1", "Table1")); } }
app.getFlyByCamera().setDragToRotate(true); app.getCamera().setFrustumPerspective(45f, (float) app.getCamera().getWidth() / app.getCamera().getHeight(), 0.1f, 1000f); app.getCamera().setLocation(new Vector3f(6.2354145f, 18.598438f, 4.6557f)); app.getCamera().setRotation(new Quaternion(0.5041053f, -0.49580166f, 0.5068195f, 0.4931456f)); CameraControl cc = new CameraControl(app.getCamera(), CameraControl.ControlDirection.CameraToSpatial); camFollower.addControl(cc); app.getRootNode().attachChild(camFollower);