/** * Sets the minimal vertical rotation angle in radian of the camera around * the target default is 0; * * @param minHeight */ public void setMinVerticalRotation(float minHeight) { this.minVerticalRotation = minHeight; if(initialized){ rotateCamera(); } }
/** * Sets the maximal vertical rotation angle in radian of the camera around * the target. Default is Pi/2; * * @param maxVerticalRotation */ public void setMaxVerticalRotation(float maxVerticalRotation) { this.maxVerticalRotation = maxVerticalRotation; if(initialized){ rotateCamera(); } }
public void onAnalog(String name, float value, float tpf) { if (isEnabled()) { if (canRotate) { if (name.equals(CameraInput.CHASECAM_MOVELEFT)) { horizontalRotation -= value * rotationSpeed; rotateCamera(); } else if (name.equals(CameraInput.CHASECAM_MOVERIGHT)) { horizontalRotation += value * rotationSpeed; rotateCamera(); } else if (name.equals(CameraInput.CHASECAM_UP)) { verticalRotation += value * rotationSpeed; rotateCamera(); } else if (name.equals(CameraInput.CHASECAM_DOWN)) { verticalRotation -= value * rotationSpeed; rotateCamera(); } } if (name.equals(CameraInput.CHASECAM_ZOOMIN)) { zoomCamera(-value * zoomSpeed); } else if (name.equals(CameraInput.CHASECAM_ZOOMOUT)) { zoomCamera(+value * zoomSpeed); } } }
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.inputManager = app.getInputManager(); target = new Node("ChaseCamTarget"); camNode.setCamera(app.getCamera()); camNode.setControlDir(CameraControl.ControlDirection.SpatialToCamera); target.attachChild(camNode); camNode.setLocalTranslation(0, 0, distance); upVector = app.getCamera().getUp().clone(); leftVector = app.getCamera().getLeft().clone(); registerWithInput(); rotateCamera(); }
/** * Sets the minimal vertical rotation angle in radian of the camera around * the target default is 0; * * @param minHeight */ public void setMinVerticalRotation(float minHeight) { this.minVerticalRotation = minHeight; if(initialized){ rotateCamera(); } }
/** * Sets the maximal vertical rotation angle in radian of the camera around * the target. Default is Pi/2; * * @param maxVerticalRotation */ public void setMaxVerticalRotation(float maxVerticalRotation) { this.maxVerticalRotation = maxVerticalRotation; if(initialized){ rotateCamera(); } }
public void onAnalog(String name, float value, float tpf) { if (isEnabled()) { if (canRotate) { if (name.equals(CameraInput.CHASECAM_MOVELEFT)) { horizontalRotation -= value * rotationSpeed; rotateCamera(); } else if (name.equals(CameraInput.CHASECAM_MOVERIGHT)) { horizontalRotation += value * rotationSpeed; rotateCamera(); } else if (name.equals(CameraInput.CHASECAM_UP)) { verticalRotation += value * rotationSpeed; rotateCamera(); } else if (name.equals(CameraInput.CHASECAM_DOWN)) { verticalRotation -= value * rotationSpeed; rotateCamera(); } } if (name.equals(CameraInput.CHASECAM_ZOOMIN)) { zoomCamera(-value * zoomSpeed); } else if (name.equals(CameraInput.CHASECAM_ZOOMOUT)) { zoomCamera(+value * zoomSpeed); } } }
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.inputManager = app.getInputManager(); target = new Node("ChaseCamTarget"); camNode.setCamera(app.getCamera()); camNode.setControlDir(CameraControl.ControlDirection.SpatialToCamera); target.attachChild(camNode); camNode.setLocalTranslation(0, 0, distance); upVector = app.getCamera().getUp().clone(); leftVector = app.getCamera().getLeft().clone(); registerWithInput(); rotateCamera(); }