/// <summary> /// Handles the GestureRecognized event of the g control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="KinectSkeltonTracker.GestureEventArgs"/> instance containing the event data.</param> //private void Gesture_GestureRecognized(object sender, GestureEventArgs e) private void OnGestureRecognized(object sender, GestureEventArgs e) { if (this.GestureRecognized != null) { this.GestureRecognized(this, e); } foreach (Gesture g in this.gestures) { g.Reset(); } }
/// AUTHOR: KHALED private void OnGestureRecognized(object sender, GestureEventArgs e) { Debug.WriteLine(e.GestureType); switch (e.GestureType) { case GestureType.BendGesture: Gesture = "BendGesture"; Constants.isBending = true; break; case GestureType.PunchGesture: Gesture = "PunchGesture"; Constants.isPunching = true; break; case GestureType.StepRightGesture: Gesture = "StepRightGesture"; Constants.isSteppingRight = true; break; case GestureType.RunningGesture: Gesture = "RunningGesture"; Constants.isRunning = true; Constants.numberOfRuns++; break; case GestureType.DumbbellGesture: Gesture = "DumbbellGesture"; Constants.isDumbbell = true; Constants.numberOfDumbbells++; break; default: break; } }