Created
May 29, 2014 09:18
-
-
Save elbruno/7f96407ea0b59f894ba8 to your computer and use it in GitHub Desktop.
El Bruno - Leap V2 SDK Beta Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Leap; | |
namespace ElBruno.LeapV2NewFeatures | |
{ | |
public class MotionListener : Listener | |
{ | |
public event Action<bool, bool> OnLeftOrRightHand; | |
public event Action<float, float> OnPitchAndGrab; | |
public override void OnFrame(Controller controller) | |
{ | |
var frame = controller.Frame(); | |
if (frame.Hands.IsEmpty) return; | |
var hand = frame.Hands[0]; | |
Task.Factory.StartNew(() => OnLeftOrRightHand(hand.IsLeft, hand.IsRight)); | |
Task.Factory.StartNew(() => OnPitchAndGrab(hand.PinchStrength, hand.GrabStrength)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment