Exemple #1
0
 public SerializableKeyFrame(OrbitCameraKeyFrame ok)
 {
     this.cameraMode = CameraMode.Orbit;
     this.position   = new SerializableVector3(ok.position);
     this.rotation   = new SerializableQuaternion(ok.rotation);
     this.yOffset    = ok.focusOffsetY;
     this.radialPos  = ok.radialPos;
     this.fov        = ok.fov;
     this.time       = ok.time;
 }
Exemple #2
0
 public OrbitCameraKeyFrame(Vector3Radial radialPos, Vector3 pos, Quaternion rot, float yOffset, float fov, float t, CameraCurve cameraCurve)
 {
     this.radialPos    = radialPos;
     position          = PlayerController.Instance.skaterController.skaterTransform.position + Vector3.up * focusOffsetY + radialPos.cartesianCoords;
     rotation          = Quaternion.LookRotation(-radialPos.cartesianCoords, Vector3.up);
     this.time         = t;
     this.fov          = fov;
     this.focusOffsetY = yOffset;
     AddKeyframes(cameraCurve);
 }
 public void Awake()
 {
     this.manager          = base.GetComponent <ReplayManager>();
     this.cameraTransform  = PlayerController.Instance.cameraController._actualCam;
     this.camera           = cameraTransform.GetComponent <Camera>();
     this.mode             = CameraMode.Orbit;
     this.keyFrames        = new List <KeyFrame>();
     this.orbitRadialCoord = new Vector3Radial(this.cameraTransform.position - PlayerController.Instance.skaterController.skaterTransform.position);
     this.FocusOffsetY     = 0f;
     this.cameraCurve      = new CameraCurve();
 }
        private void SwitchModeTo(CameraMode newValue)
        {
            CameraMode cameraMode = this.mode;

            if (newValue == cameraMode)
            {
                return;
            }
            this.mode = newValue;
            if (newValue == CameraMode.Orbit)
            {
                this.orbitRadialCoord = new Vector3Radial(this.cameraTransform.position - PlayerController.Instance.skaterController.transform.position);
            }
        }
        public void OnStartReplayEditor()
        {
            while (this.keyFrames.Count > 0 && this.keyFrames[0].time < this.manager.recorder.startTime)
            {
                this.keyFrames.RemoveAt(0);
            }
            base.enabled = true;
            if (this.mode == CameraMode.Orbit)
            {
                this.orbitRadialCoord = new Vector3Radial(this.cameraTransform.position - PlayerController.Instance.skaterController.skaterTransform.position);
            }
            this.cameraParent = this.cameraTransform.parent;
            PlayerController.Instance.cameraController._actualCam.SetParent(null);
            CameraMovementController cameraMovementController = UnityEngine.Object.FindObjectOfType <CameraMovementController>();

            if (cameraMovementController)
            {
                cameraMovementController.enabled = false;
            }
            defaultCameraFOV = camera.fieldOfView;
        }
Exemple #6
0
 public static Vector3Radial Lerp(Vector3Radial l, Vector3Radial r, float t)
 {
     return(new Vector3Radial(Mathf.LerpAngle(l.phi, r.phi, t), Mathf.LerpAngle(l.theta, r.theta, t), Mathf.Lerp(l.radius, r.radius, t)));
 }