@Override public void simpleInitApp() { flyCam.setMoveSpeed(10); Node scene = (Node) assetManager.loadModel("Scenes/ManyLights/Main.scene"); rootNode.attachChild(scene); // guiNode.setCullHint(CullHint.Always); }
@Override public void simpleInitApp() { maxAniso = renderer.getLimits().get(Limits.TextureAnisotropy); flyCam.setDragToRotate(true); flyCam.setMoveSpeed(100); cam.setLocation(new Vector3f(197.02617f, 4.6769195f, -194.89545f)); cam.setRotation(new Quaternion(0.07921988f, 0.8992258f, -0.18292196f, 0.38943136f)); Quad q = new Quad(1000, 1000); q.scaleTextureCoordinates(new Vector2f(1000, 1000)); Geometry geom = new Geometry("quad", q); geom.rotate(-FastMath.HALF_PI, 0, 0); geom.setMaterial(createCheckerBoardMaterial(assetManager)); rootNode.attachChild(geom); inputManager.addMapping("higher", new KeyTrigger(KeyInput.KEY_1)); inputManager.addMapping("lower", new KeyTrigger(KeyInput.KEY_2)); inputManager.addListener(this, "higher"); inputManager.addListener(this, "lower"); }
public void setupCamera() { flyCam.setEnabled(false); }
rotateCamera(value, initialUpVec); }else if (name.equals(CameraInput.FLYCAM_RIGHT)){ rotateCamera(-value, initialUpVec); }else if (name.equals(CameraInput.FLYCAM_UP)){ rotateCamera(-value * (invertY ? -1 : 1), cam.getLeft()); }else if (name.equals(CameraInput.FLYCAM_DOWN)){ rotateCamera(value * (invertY ? -1 : 1), cam.getLeft()); }else if (name.equals(CameraInput.FLYCAM_FORWARD)){ moveCamera(value, false); }else if (name.equals(CameraInput.FLYCAM_BACKWARD)){ moveCamera(-value, false); }else if (name.equals(CameraInput.FLYCAM_STRAFELEFT)){ moveCamera(value, true); }else if (name.equals(CameraInput.FLYCAM_STRAFERIGHT)){ moveCamera(-value, true); }else if (name.equals(CameraInput.FLYCAM_RISE)){ riseCamera(value); }else if (name.equals(CameraInput.FLYCAM_LOWER)){ riseCamera(-value); }else if (name.equals(CameraInput.FLYCAM_ZOOMIN)){ zoomCamera(value); }else if (name.equals(CameraInput.FLYCAM_ZOOMOUT)){ zoomCamera(-value);
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.app = app; if (app.getInputManager() != null) { if (flyCam == null) { flyCam = new FlyByCamera(app.getCamera()); } flyCam.registerWithInput(app.getInputManager()); } }
setPauseOnLostFocus(false); flyCam.setMoveSpeed(5); flyCam.setDragToRotate(true); flyCam.setEnabled(false); viewPort.setBackgroundColor(new ColorRGBA().setAsSrgb(0.2f, 0.2f, 0.2f, 1.0f)); rootNode.attachChild(autoRotate);
flyCam.setDragToRotate(true); flyCam.setZoomSpeed(10.0f); flyCam.setMoveSpeed(10.0f);
public Void call(){ if (app instanceof SimpleApplication){ SimpleApplication simpleApp = (SimpleApplication) app; simpleApp.getFlyByCamera().setDragToRotate(true); } return null; } });
flyCam.setMoveSpeed(15); flyCam.setEnabled(false);
flyCam = new FlyByCamera(cam); flyCam.setMoveSpeed(1f); // odd to set this here but it did it before stateManager.getState(FlyCamAppState.class).setCamera( flyCam );
@Override public void initialize() { super.initialize(); guiNode.setQueueBucket(Bucket.Gui); guiNode.setCullHint(CullHint.Never); loadFPSText(); loadStatsView(); viewPort.attachScene(rootNode); guiViewPort.attachScene(guiNode); if (inputManager != null) { flyCam = new FlyByCamera(cam); flyCam.setMoveSpeed(1f); flyCam.registerWithInput(inputManager); if (context.getType() == Type.Display) { inputManager.addMapping(INPUT_MAPPING_EXIT, new KeyTrigger(KeyInput.KEY_ESCAPE)); } inputManager.addMapping(INPUT_MAPPING_CAMERA_POS, new KeyTrigger(KeyInput.KEY_C)); inputManager.addMapping(INPUT_MAPPING_MEMORY, new KeyTrigger(KeyInput.KEY_M)); inputManager.addMapping(INPUT_MAPPING_HIDE_STATS, new KeyTrigger(KeyInput.KEY_F5)); inputManager.addListener(actionListener, INPUT_MAPPING_EXIT, INPUT_MAPPING_CAMERA_POS, INPUT_MAPPING_MEMORY, INPUT_MAPPING_HIDE_STATS); } // call user code simpleInitApp(); }
flyCam.setDragToRotate(true); flyCam.setZoomSpeed(10.0f); flyCam.setMoveSpeed(10.0f);
@Override public void simpleInitApp() { inBetweenNode = new Node("In Between Node"); rootNode.attachChild(inBetweenNode); flyCam.setDragToRotate(true); } }
flyCam = new FlyByCamera(cam); flyCam.setMoveSpeed(1f); // odd to set this here but it did it before stateManager.getState(FlyCamAppState.class).setCamera( flyCam );
public void onAnalog(String name, float value, float tpf) { if (!enabled) return; if (name.equals("FLYCAM_Left")){ rotateCamera(value, initialUpVec); }else if (name.equals("FLYCAM_Right")){ rotateCamera(-value, initialUpVec); }else if (name.equals("FLYCAM_Up")){ rotateCamera(-value, cam.getLeft()); }else if (name.equals("FLYCAM_Down")){ rotateCamera(value, cam.getLeft()); }else if (name.equals("FLYCAM_Forward")){ moveCamera(value, false); }else if (name.equals("FLYCAM_Backward")){ moveCamera(-value, false); }else if (name.equals("FLYCAM_StrafeLeft")){ moveCamera(value, true); }else if (name.equals("FLYCAM_StrafeRight")){ moveCamera(-value, true); }else if (name.equals("FLYCAM_Rise")){ riseCamera(value); }else if (name.equals("FLYCAM_Lower")){ riseCamera(-value); }else if (name.equals("FLYCAM_ZoomIn")){ zoomCamera(value); }else if (name.equals("FLYCAM_ZoomOut")){ zoomCamera(-value); } }
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.app = app; if (app.getInputManager() != null) { if (flyCam == null) { flyCam = new FlyByCamera(app.getCamera()); } flyCam.registerWithInput(app.getInputManager()); } }
private void setupKeys() { flyCam.setMoveSpeed(100); inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T)); inputManager.addListener(actionListener, "wireframe"); } private ActionListener actionListener = new ActionListener() {
@Override public void simpleInitApp() { flyCam.setMoveSpeed(10f); flyCam.setDragToRotate(true); setPauseOnLostFocus(false); cam.setLocation(new Vector3f(24.746134f, 13.081396f, 32.72753f)); cam.setRotation(new Quaternion(-0.06867662f, 0.92435044f, -0.19981281f, -0.31770203f)); makeHudText(); DirectionalLight dl = new DirectionalLight(); dl.setDirection(new Vector3f(-0.1f, -0.7f, -1).normalizeLocal()); dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f)); rootNode.addLight(dl); for (int i = 0; i < SIZE; i++) { for (int j = 0; j < SIZE; j++) { Spatial model = (Spatial) assetManager.loadModel("Models/Oto/OtoOldAnim.j3o"); model.setLocalScale(0.1f); model.setLocalTranslation(i - SIZE / 2, 0, j - SIZE / 2); control = model.getControl(AnimControl.class); channel = control.createChannel(); channel.setAnim(animNames[(i + j) % 4]); SkeletonControl skeletonControl = model.getControl(SkeletonControl.class); skeletonControl.setHardwareSkinningPreferred(hwSkinningEnable); skControls.add(skeletonControl); rootNode.attachChild(model); } } inputManager.addListener(this, "toggleHWS"); inputManager.addMapping("toggleHWS", new KeyTrigger(KeyInput.KEY_SPACE)); }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); flyCam.setEnabled(enabled); }
public Void call(){ if (app instanceof SimpleApplication){ SimpleApplication simpleApp = (SimpleApplication) app; simpleApp.getFlyByCamera().setDragToRotate(true); simpleApp.getInputManager().setCursorVisible(true); } return null; } });