Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 internal void DoSmoothTurn(float angle)
 {
     m_origin.RotatePlayer(Quaternion.Euler(new Vector3(0, angle, 0f)));
     OnSnapTurn?.Invoke();
 }