private void ActiveUpdate() { var newPos = HandModel.GetIndexVector(); var pan = newPos - _lastPos; _lastPos = newPos; _panEvent.Invoke(pan.x * PAN_SPEED, pan.y * PAN_SPEED, 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); }
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); }
public override void Update() { _fist.Update(); if (_fist.Triggered) { if (State == GestureSeqState.Listening) { _lastPos = HandModel.GetIndexVector(); } State = GestureSeqState.Active; ActiveUpdate(); } else { State = GestureSeqState.Listening; } }
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; } }