Ejemplo n.º 1
0
        public void HandleCameraView()
        {
            if (pluginSettings.ready)
            {
                // Call the camera's behavior.
                currentCamera.ApplyBehavior(ref cameraPositionTarget, ref cameraLookAtTarget, player, isCameraStatic);
                isCameraStatic = currentCamera.staticCamera;


                if (currentAvatar != null)
                {
                    if (pluginSettings.removeAvatarInsteadOfHead)
                    {
                        currentAvatar.avatarSettings.showAvatar.Value = !currentCamera.removeHead;
                    }
                    else
                    {
                        currentAvatar.avatarSettings.showAvatarHead.Value = !currentCamera.removeHead;
                    }
                    timerHelper.ResetRemoveAvatarTimer();
                }

                cameraPosition = Vector3.SmoothDamp(cameraPosition, cameraPositionTarget, ref cameraVelocity, currentCamera.GetBetweenTime());
                cameraLookAt   = Vector3.SmoothDamp(cameraLookAt, cameraLookAtTarget, ref cameraLookAtVelocity, currentCamera.GetBetweenTime());

                Vector3 lookDirection = cameraLookAt - cameraPosition;

                Quaternion rotation = currentCamera.GetRotation(lookDirection, player);

                cameraHelper.UpdateCameraPose(cameraPosition, rotation, currentCamera.GetFOV());
            }
        }
Ejemplo n.º 2
0
 public override float GetBetweenTime()
 {
     return(Mathf.Lerp(base.GetBetweenTime(), sightsCamera.GetBetweenTime(), blend));
 }