Ejemplo n.º 1
0
        private void ActiveUpdate()
        {
            var curpos = HandModel.GetIndexVector();
            var rp     = new Polar3(curpos - _anchor);                  // rp  = relative position
            var rrp    = rp - _lastRp;                                  // rrp = relative relative position

            _lastRp = rp;

            var factor = -150f;

            _zoomEvent.Invoke((float)rrp.R * factor);
        }
Ejemplo n.º 2
0
        private void ActiveUpdate()
        {
            var curpos = HandModel.GetIndexVector();
            var rp     = new Polar3(curpos - _anchor);
            var rrp    = rp - _lastRp;

            _lastRp = rp;

            //Debug.Log("rp: " + rp.ToString(3,1000) + "   rrp: " + rrp.ToString(3,100));

            var   factor = 50;
            float theta  = (float)rrp.Theta * factor;
            float phi    = (float)rrp.Phi * factor;

            _rotateEvent.Invoke(-theta, -phi, 0);
        }
Ejemplo n.º 3
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;
            }
        }