private void BuiltInImprovedGestureRecognised(Leap.Gesture gesture, EasyLeapGestureType type) { if (!gestureList.ContainsKey(-(int)type)) { RecordNewGesture(-(int)type, EasyLeapGestureState.STATESTOP, EasyLeapGestureState.STATEUPDATE, type, -1, gesture.Hands[0].StabilizedPalmPosition); } }
private void NumbersGestureRecognised(EasyLeapGestureType type) { if (type != EasyLeapGestureType.DEFAULT) { RecordNewGesture(-(int)type, EasyLeapGestureState.STATESTART, EasyLeapGestureState.STATEUPDATE, type, -1, mFrame.Hands[0].StabilizedPalmPosition); } if (gestureList.Count == 0) { return; } for (int ii = (int)EasyLeapGestureType.ONE; ii <= (int)EasyLeapGestureType.TEN; ii++) { if (type != (EasyLeapGestureType)(ii) && gestureList.ContainsKey(-ii)) { EasyLeapGesture g = gestureList[-ii]; g.State = EasyLeapGestureState.STATESTOP; gestureList[-(int)ii] = g; } } }
// Store the recognised gesture on the gesture List private void RecordNewGesture(int id, EasyLeapGestureState startState, EasyLeapGestureState updateState, EasyLeapGestureType type, long duration, Leap.Vector position) { if(gestureList.ContainsKey(id)) { EasyLeapGesture g = gestureList[id]; g.State = updateState; g.Duration = duration < 0 ? (long)(1000000*Time.deltaTime)+g.Duration : duration; gestureList[id] = g; } else { EasyLeapGesture gest = new EasyLeapGesture(); gest.Duration = 0; gest.Id = id; gest.State = startState; gest.Type = type; gest.Frame = mFrame; gest.Position = position; gestureList.Add(id,gest); } }
private void NumbersGestureRecognised(EasyLeapGestureType type) { if(type != EasyLeapGestureType.DEFAULT) { RecordNewGesture(-(int)type,EasyLeapGestureState.STATESTART,EasyLeapGestureState.STATEUPDATE,type,-1,mFrame.Hands[0].StabilizedPalmPosition); } if(gestureList.Count == 0) return; for(int ii =(int)EasyLeapGestureType.ONE; ii<=(int)EasyLeapGestureType.TEN; ii++) { if(type != (EasyLeapGestureType)(ii) && gestureList.ContainsKey(-ii)) { EasyLeapGesture g = gestureList[-ii]; g.State = EasyLeapGestureState.STATESTOP; gestureList[-(int)ii] = g; } } }
private void BuiltInImprovedGestureRecognised(Leap.Gesture gesture, EasyLeapGestureType type) { if(!gestureList.ContainsKey(-(int)type)) { RecordNewGesture(-(int)type, EasyLeapGestureState.STATESTOP, EasyLeapGestureState.STATEUPDATE, type, -1, gesture.Hands[0].StabilizedPalmPosition); } }
private void BuiltInGestureRecognised(Leap.Gesture gesture, EasyLeapGestureType type) { RecordNewGesture(gesture.Id,ConvertGestureState(gesture.State),ConvertGestureState(gesture.State),type,gesture.Duration,gesture.Hands[0].StabilizedPalmPosition); }
private void BuiltInGestureRecognised(Leap.Gesture gesture, EasyLeapGestureType type) { RecordNewGesture(gesture.Id, ConvertGestureState(gesture.State), ConvertGestureState(gesture.State), type, gesture.Duration, gesture.Hands[0].StabilizedPalmPosition); }
// Store the recognised gesture on the gesture List private void RecordNewGesture(int id, EasyLeapGestureState startState, EasyLeapGestureState updateState, EasyLeapGestureType type, long duration, Leap.Vector position) { if (gestureList.ContainsKey(id)) { EasyLeapGesture g = gestureList[id]; g.State = updateState; g.Duration = duration < 0 ? (long)(1000000 * Time.deltaTime) + g.Duration : duration; gestureList[id] = g; } else { EasyLeapGesture gest = new EasyLeapGesture(); gest.Duration = 0; gest.Id = id; gest.State = startState; gest.Type = type; gest.Frame = mFrame; gest.Position = position; gestureList.Add(id, gest); } }