SHARE
TWEET

Untitled

a guest Jan 28th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3.     private IEnumerator ClosedHandCheckCoroutine()
  4.     {
  5.         while (true)
  6.         {
  7.             yield return closedHandCheckDelay;
  8.  
  9.             isHandClosed = false;
  10.  
  11.             if (ControllerSourceManager.Instance.TryGetControllerPose(TrackedHandJoint.Palm, out Vector3 palmPosition, out _))
  12.             {
  13.                 //if (ControllerSourceManager.Instance.TryGetControllerPose(TrackedHandJoint.PinkyTip, out Vector3 a, out _))
  14.                 //{
  15.                 //    isHandClosed = Vector3.Distance(palmPosition, a) < openHandFingersDistance;
  16.                 //}
  17.  
  18.                 if (!isHandClosed && ControllerSourceManager.Instance.TryGetControllerPose(TrackedHandJoint.MiddleTip, out Vector3 b, out _))
  19.                 {
  20.                     isHandClosed = Vector3.Distance(palmPosition, b) < openHandFingersDistance;
  21.                 }
  22.  
  23.                 if (!isHandClosed && ControllerSourceManager.Instance.TryGetControllerPose(TrackedHandJoint.RingTip, out Vector3 c, out _))
  24.                 {
  25.                     isHandClosed = Vector3.Distance(palmPosition, c) < openHandFingersDistance;
  26.                 }
  27.  
  28.                 if (!isHandClosed && ControllerSourceManager.Instance.TryGetControllerPose(TrackedHandJoint.IndexTip, out Vector3 d, out _))
  29.                 {
  30.                     isHandClosed = Vector3.Distance(palmPosition, d) < openHandFingersDistance;
  31.                 }
  32.             }
  33.         }
  34.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top