Esempio n. 1
0
 public CustomGesture(CustomGestureType type, Leap.Frame frame)
 {
     _type                 = type;
     _handsForGesture      = frame.Hands;
     _pointablesForGesture = frame.Pointables;
     _state                = GestureState.NA;
 }
Esempio n. 2
0
    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);
        }
    }
Esempio n. 3
0
        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;
                }
            }
        }
Esempio n. 4
0
        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;
        }