Beispiel #1
0
        public override void Update()
        {
            _pinch.Update();
            var pinchTriggered = _pinch.Triggered;

            switch (State)
            {
            case GestureSeqState.Listening:
                if (pinchTriggered)
                {
                    State    = GestureSeqState.Active;
                    _lastRot = HandModel.GetLeapHand().Rotation.Normalized.ToQuaternion().eulerAngles;
                }
                break;

            case GestureSeqState.Active:
                if (pinchTriggered)
                {
                    State = GestureSeqState.Listening;
                }
                else
                {
                    ActiveUpdate();
                }
                break;
            }
        }
Beispiel #2
0
        public override void Update()
        {
            _pinch.Update();
            var pinchTriggered = _pinch.Triggered;

            if (pinchTriggered)
            {
                if (State == GestureSeqState.Listening)
                {
                    var curpos = HandModel.GetIndexVector();
                    _anchor = curpos + new Vector3(0, 0, ANCHOR_RANGE);
                    _lastRp = new Polar3(curpos - _anchor);
                }
                State = GestureSeqState.Active;
                ActiveUpdate();
            }
            else
            {
                State = GestureSeqState.Listening;
            }
        }