public static float CameraZoom(ref CameraMovementJobState CameraMovementJobStateStruct) { var CameraObject = CameraMovementJobStateStruct.CameraObject; var CameraZoomState = CameraMovementJobStateStruct.CameraZoomState; var zoomDelta = -1 * CameraZoomState.DelteZoomFromInput * CameraMovementJobStateStruct.d; if (zoomDelta != 0f) { CameraZoomState.TargetSize = math.clamp(CameraZoomState.TargetSize + zoomDelta, MinCameraSize, MaxCameraSize); } CameraMovementJobStateStruct.CameraZoomState = CameraZoomState; return(math.lerp(CameraObject.CameraSize, CameraZoomState.TargetSize, CameraMovementJobStateStruct.d * 4f)); }
public static quaternion CameraVerticalRotation(ref CameraMovementJobState CameraMovementJobStateStruct) { var TargetCursorComponent = CameraMovementJobStateStruct.TargetCursorComponent; var CameraObject = CameraMovementJobStateStruct.CameraObject; var CameraVerticalRotationState = CameraMovementJobStateStruct.CameraVerticalRotationState; var clampedYCursorScreenPosition = 1 - math.clamp(TargetCursorComponent.TargetCursorScreenPosition.y, 0, 1); var targetVerticalAngle = math.lerp(CameraVerticalRotationState.MinAngle, CameraVerticalRotationState.MaxAngle, clampedYCursorScreenPosition); CameraVerticalRotationState.CurrentDeltaAngle = math.lerp(CameraVerticalRotationState.CurrentDeltaAngle, targetVerticalAngle, math.clamp(CameraVerticalRotationState.DampingSpeed * CameraMovementJobStateStruct.d, 0f, 1f)); CameraMovementJobStateStruct.CameraVerticalRotationState = CameraVerticalRotationState; return(quaternion.RotateX(math.radians(CameraVerticalRotationState.CurrentDeltaAngle))); }
public static float3 CameraPanningMovement(ref CameraMovementJobState CameraMovementJobStateStruct) { var TargetCursorComponent = CameraMovementJobStateStruct.TargetCursorComponent; var CameraObject = CameraMovementJobStateStruct.CameraObject; var CameraPanningState = CameraMovementJobStateStruct.CameraPanningState; CameraPanningState.TargetWorldOffset = math.inverse(math.mul(CameraObject.CameraProjectionMatrix, CameraObject.WorldToCameraMatrix)).MultiplyVector( new float3(TargetCursorComponent.TargetCursorScreenPosition, 0f)) * CameraPanningState.ScreenMovementIntensity; CameraPanningState.CurrentWorldOffset = math.lerp(CameraPanningState.CurrentWorldOffset, CameraPanningState.TargetWorldOffset, math.clamp(CameraPanningState.DampingSpeed * CameraMovementJobStateStruct.d, 0f, 1f)); CameraMovementJobStateStruct.CameraPanningState = CameraPanningState; return(CameraPanningState.CurrentWorldOffset); }
public void SetupJob(ref CameraMovementJobState CameraMovementJobState) { CameraMovementJobState.CameraZoomState.DelteZoomFromInput = this.gameInputManager.CurrentInput.CameraZoom(); }
public void InitState(ref CameraMovementJobState CameraMovementJobState) { CameraMovementJobState.CameraZoomState.TargetSize = MainCamera.orthographicSize; }
public void SetupJob(ref CameraMovementJobState CameraMovementJobState) { CameraMovementJobState.CameraPanningState.ScreenMovementIntensity = this.CameraMovementConfiguration.CameraPanningComponent.ScreenMovementIntensity; CameraMovementJobState.CameraPanningState.DampingSpeed = this.CameraMovementConfiguration.CameraPanningComponent.DampingSpeed; }
public void SetCameraMovementJobState(CameraMovementJobState CameraMovementJobState) { this.CameraMovementJobState[0] = CameraMovementJobState; }
public void SetupJob(ref CameraMovementJobState CameraMovementJobState) { CameraMovementJobState.CameraVerticalRotationState.MinAngle = this.CameraMovementConfiguration.CameraVerticalRotationComponent.MinAngle; CameraMovementJobState.CameraVerticalRotationState.MaxAngle = this.CameraMovementConfiguration.CameraVerticalRotationComponent.MaxAngle; CameraMovementJobState.CameraVerticalRotationState.DampingSpeed = this.CameraMovementConfiguration.CameraVerticalRotationComponent.DampingSpeed; }
public void InitState(ref CameraMovementJobState CameraMovementJobState) { CameraMovementJobState.CameraVerticalRotationState.CurrentDeltaAngle = 0f; }
public void SetupJob(ref CameraMovementJobState CameraMovementJobState) { CameraMovementJobState.CameraOrientationState.IsRotating = this.gameInputManager.CurrentInput.RotationCameraDH(); CameraMovementJobState.CameraOrientationState.LeftRotationFromInput = gameInputManager.CurrentInput.LeftRotationCamera(); CameraMovementJobState.CameraOrientationState.RightRotationFromInput = gameInputManager.CurrentInput.RightRotationCamera(); }