/// <summary> /// Initializes the components of the Manoclass,Continuous Gesture and Trigger Gesture Gizmos /// </summary> void SetGestureDescriptionParts() { /* manoClassText = manoClassGizmo.transform.Find("Description").GetComponent<Text>(); * handSideText = handSideGizmo.transform.Find("Description").GetComponent<Text>(); * continuousGestureText = continuousGestureGizmo.transform.Find("Description").GetComponent<Text>();*/ palmCenterRectTransform = palmCenterGizmo.GetComponent <RectTransform>(); palmCenterFillAmmount = palmCenterGizmo.transform.GetChild(0).GetComponent <RectTransform>(); poiRectTransform = POIGizmo.GetComponent <RectTransform>(); poiFillAmmount = POIGizmo.transform.GetChild(0).GetComponent <RectTransform>(); }
/// <summary> /// Display the POI cursor /// </summary> /// <param name="gesture">Gesture.</param> /// <param name="warning">Warning.</param> /// <param name="trackingInfo">Tracking info.</param> void DisplayPOI(GestureInfo gesture, Warning warning, TrackingInfo trackingInfo) { bool isPinchWellDetected = currentThumbCounter > maxThumbCounter / 2; if (ShowPOI) { if (gesture.mano_class == ManoClass.PINCH_GESTURE_FAMILY) { if (currentThumbCounter < maxThumbCounter) { currentThumbCounter++; } } else { if (currentThumbCounter > minThumbCounter) { currentThumbCounter--; } } if (warning != Warning.WARNING_HAND_NOT_FOUND && isPinchWellDetected) { if (!POIGizmo.activeInHierarchy) { POIGizmo.SetActive(true); } float smoothing = 1 - ManomotionManager.Instance.Manomotion_Session.smoothing_controller; poiRectTransform.position = Camera.main.ViewportToScreenPoint(trackingInfo.poi); float newFillAmmount = 1 - ((int)(gesture.state / 6) * 0.25f); poiFillAmmount.localScale = Vector3.Lerp(palmCenterFillAmmount.localScale, Vector3.one * newFillAmmount, 0.9f); } else { if (POIGizmo.activeInHierarchy) { POIGizmo.SetActive(false); } } } else { if (POIGizmo.activeInHierarchy) { POIGizmo.SetActive(false); } } }