public CustomGesture(CustomGestureType type, Leap.Frame frame) { _type = type; _handsForGesture = frame.Hands; _pointablesForGesture = frame.Pointables; _state = GestureState.NA; }
private void SelectNewGesture() { isNextGestureTrackedByNuitrack = (Random.Range(1, 10) >= 2); if (isNextGestureTrackedByNuitrack) { List <nuitrack.GestureType> gestures = new List <nuitrack.GestureType>(); foreach (var gesture in possibleNuitrackGestures) { gestures.Add(gesture.Key); } targetNuitrackGesture = gestures[Random.Range(0, gestures.Count)]; } else { List <CustomGestureType> gestures = new List <CustomGestureType>(); foreach (var gesture in possibleCustomGestures) { gestures.Add(gesture.Key); } targetCustomGesture = gestures[Random.Range(0, gestures.Count)]; timestamp = Time.time; Invoke("OnStartDataCollection", 3f); } }
public HandSwipe(CustomGestureType type, Leap.Frame frame) : base(type, frame) { if (other != null) { if (other.State.Equals(GestureState.NA)) { _state = GestureState.START; } else if (other.State.Equals(GestureState.END)) { _state = GestureState.NA; } else { _state = GestureState.MIDDLE; } } other = this; foreach (Leap.Hand hand in _handsForGesture) { if (hand.PalmVelocity.x > 0) { _diretion = SwipeDirection.RIGHT; } else { _diretion = SwipeDirection.LEFT; } } }
public ZoomIn(CustomGestureType type, Leap.Frame frame) : base(type, frame) { if (other != null) { if (other.State.Equals(GestureState.NA)) { _state = GestureState.START; } else if (other.State.Equals(GestureState.END)) { _state = GestureState.NA; } else { _state = GestureState.MIDDLE; } } other = this; }