浏览代码

Fixed fast camera rotation issue

/main
Ciro Continisio 3 年前
当前提交
db88cbec
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 8
      UOP1_Project/Assets/Scripts/Camera/CameraManager.cs

8
UOP1_Project/Assets/Scripts/Camera/CameraManager.cs


if (isDeviceMouse && !_isRMBPressed)
return;
freeLookVCam.m_XAxis.m_InputAxisValue = cameraMovement.x * Time.deltaTime * _speedMultiplier;
freeLookVCam.m_YAxis.m_InputAxisValue = cameraMovement.y * Time.deltaTime * _speedMultiplier;
//Using a "fixed delta time" if the device is mouse,
//since for the mouse we don't have to account for frame duration
float deviceMultiplier = isDeviceMouse ? 0.02f : Time.deltaTime;
freeLookVCam.m_XAxis.m_InputAxisValue = cameraMovement.x * deviceMultiplier * _speedMultiplier;
freeLookVCam.m_YAxis.m_InputAxisValue = cameraMovement.y * deviceMultiplier * _speedMultiplier;
}
private void OnFrameObjectEvent(Transform value)

正在加载...
取消
保存