예제 #1
0
 // Token: 0x060062B0 RID: 25264 RVA: 0x00232CA0 File Offset: 0x002310A0
 private void UpdateActiveCursorSet()
 {
     if (this.activeCursor == VRCUiCursorManager.CursorType.None)
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Gaze;
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Vive) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Vive))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Hydra) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Hydra))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
         if (VRCInputManager.IsEnabled(VRCInputManager.InputMethod.Oculus) && VRCInputManager.IsPresent(VRCInputManager.InputMethod.Oculus))
         {
             this.activeCursor = VRCUiCursorManager.CursorType.Hands;
         }
     }
     if (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Hydra) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Vive) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Oculus))
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Hands;
     }
     else if ((VRCInputManager.AnyKey(VRCInputManager.InputMethod.Controller) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Keyboard)) && HMDManager.IsHmdDetected())
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Gaze;
     }
     else if (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Mouse))
     {
         this.activeCursor = VRCUiCursorManager.CursorType.Mouse;
     }
 }
예제 #2
0
    // Token: 0x060051C0 RID: 20928 RVA: 0x001C0038 File Offset: 0x001BE438
    protected override void FixedUpdate()
    {
        bool flag = this.linked;

        if (this.linked)
        {
            this.UpdateIntraFrameMotion();
            this.UpdateTrackingMotion();
            InputStateController.lastPosition = base.transform.position;
            InputStateController.lastRotation = base.transform.rotation;
            this.speed = 0f;
        }
        Vector3    zero     = Vector3.zero;
        Quaternion identity = Quaternion.identity;

        this.linked = true;
        if (this.immobilize)
        {
            this.motionState.IsImmobilized = true;
        }
        else
        {
            this.motionState.IsImmobilized = false;
            bool flag2 = false;
            if (this.inAxisVertical.axis > 0.5f && this.inAxisVertical.axis > Mathf.Abs(this.inAxisHorizontal.axis) && (VRCInputManager.AnyKey(VRCInputManager.InputMethod.Hydra) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Vive) || VRCInputManager.AnyKey(VRCInputManager.InputMethod.Oculus)))
            {
                flag2 = true;
            }
            if (LocomotionInputController.navigationCursorActive || flag2)
            {
                this.UpdateLocomotionFromCursor(out zero, out identity);
            }
            else
            {
                this.UpdateLocomotionFromController(out zero, out identity);
            }
        }
        this.motionState.SetLocomotion(zero, Time.deltaTime);
        if (zero.sqrMagnitude > 0f)
        {
            this.motionState.isLocomoting = true;
        }
        else
        {
            this.motionState.isLocomoting = false;
        }
        if (VRCTrackingManager.IsPlayerNearTracking() && !this.linked)
        {
            VRCTrackingManager.SetPlayerNearTracking(false);
        }
        if (this.linked)
        {
            base.transform.Rotate(this.CalculateRotation(Time.deltaTime));
            Vector3 playerWorldMotion = base.transform.position - InputStateController.lastPosition;
            playerWorldMotion.y = base.transform.position.y - VRCTrackingManager.GetTrackingWorldOrigin().y;
            Quaternion playerWorldRotation = Quaternion.Inverse(InputStateController.lastRotation) * base.transform.rotation;
            if (this.linked && !flag && !VRCInputManager.thirdPersonRotation)
            {
                playerWorldRotation = Quaternion.identity;
            }
            VRCTrackingManager.ApplyPlayerMotion(playerWorldMotion, playerWorldRotation);
            InputStateController.lastPosition = base.transform.position;
            InputStateController.lastRotation = base.transform.rotation;
        }
        else
        {
            base.transform.rotation = Quaternion.Slerp(base.transform.rotation, identity, 10f * Time.deltaTime);
            Vector3 euler = this.CalculateRotation(Time.deltaTime);
            VRCTrackingManager.ApplyPlayerMotion(Vector3.zero, Quaternion.Euler(euler));
        }
        this.IsFirstPhysicsStepThisFrame = false;
    }