protected override bool CheckGesture(VyroGesture gesture) { var circle = gesture as VyroGestureCircle; if (circle == null) { return(false); } return(circle.IsClockwise == IsClockwise && circle.Radius >= MinRadius && circle.Radius <= MaxRadius); }
public void Dispatch(VyroGesture gesture) { foreach (GestureTrigger trigger in _Triggers.Values.Where(t => t is GestureTrigger)) { if (trigger.Check(gesture)) { trigger.Activate(); } } }
protected override bool CheckGesture(VyroGesture gesture) { var swipe = gesture as VyroGestureSwipe; if (swipe == null) { return(false); } var angle = swipe.Direction.RollDegrees(); if (angle < 0) { angle += 360; } return( swipe.Velocity >= MinVelocity && swipe.Velocity <= MaxVelocity && swipe.Distance >= MinDistance && swipe.Distance <= MaxDistance && angle >= MinAngle && angle <= MaxAngle ); }
public bool Check(VyroGesture gesture) { return(CheckHand(gesture.HandIds) && CheckGesture(gesture)); }
protected abstract bool CheckGesture(VyroGesture gesture);