public void DoSnapTurn(float angle) { if (m_lastSnapTurnTime + m_snapTurnDelay < Time.time) { SnapTurnFade(.2f); m_origin.RotatePlayer(Quaternion.Euler(new Vector3(0, angle, 0f))); m_lastSnapTurnTime = Time.time; OnSnapTurn?.Invoke(); } }
public void DoSnapTurnTowards(Vector3 direction, float fadeDuration) { Vector3 deltaRot = Quaternion.LookRotation(direction).eulerAngles; deltaRot.x = 0; deltaRot.z = 0; deltaRot.y -= HMD.GetVRCameraEulerRelativeToFPSCameraParent().y; m_origin.RotatePlayer(Quaternion.Euler(deltaRot)); SnapTurnFade(fadeDuration); OnSnapTurn.Invoke(); }
internal void DoSmoothTurn(float angle) { m_origin.RotatePlayer(Quaternion.Euler(new Vector3(0, angle, 0f))); OnSnapTurn?.Invoke(); }