public void onAction(String name, boolean keyPressed, float tpf) { if (isEnabled()) { if (dragToRotate) { if (name.equals(CameraInput.CHASECAM_TOGGLEROTATE) && isEnabled()) { if (keyPressed) { canRotate = true; if (hideCursorOnRotate) { inputManager.setCursorVisible(false); } } else { canRotate = false; if (hideCursorOnRotate) { inputManager.setCursorVisible(true); } } } } } }
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); } } }
public void onAction(String name, boolean keyPressed, float tpf) { if (isEnabled()) { if (dragToRotate) { if (name.equals(CameraInput.CHASECAM_TOGGLEROTATE) && isEnabled()) { if (keyPressed) { canRotate = true; if (hideCursorOnRotate) { inputManager.setCursorVisible(false); } } else { canRotate = false; if (hideCursorOnRotate) { inputManager.setCursorVisible(true); } } } } } }
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); } } }