Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement