/// <summary> /// Creates the frame sequence that defines the gesture. /// </summary> /// <returns>Gesture's frame sequence</returns> private IKinectGestureFrame[] CreateGestureFrames() { KinectGestureWaveRightHandFrame1 frame1 = new KinectGestureWaveRightHandFrame1(); KinectGestureWaveRightHandFrame2 frame2 = new KinectGestureWaveRightHandFrame2(); IKinectGestureFrame[] gesture = new IKinectGestureFrame[6] { frame1, frame2, frame1, frame2, frame1, frame2 }; return gesture; }
/// <summary> /// Creates the frame sequence that defines the gesture. /// </summary> /// <returns>Gesture's frame sequence</returns> private IKinectGestureFrame[] CreateGestureFrames() { KinectGestureSwipeTopToBottomFrame1 frame1 = new KinectGestureSwipeTopToBottomFrame1(); KinectGestureSwipeTopToBottomFrame2 frame2 = new KinectGestureSwipeTopToBottomFrame2(); KinectGestureSwipeTopToBottomFrame3 frame3 = new KinectGestureSwipeTopToBottomFrame3(); IKinectGestureFrame[] gesture = new IKinectGestureFrame[5] { frame1, frame2, frame3, frame2, frame1 }; return gesture; }
/// <summary> /// Creates the frame sequence that defines the gesture. /// </summary> /// <returns>Gesture's frame sequence</returns> private IKinectGestureFrame[] CreateGestureFrames() { KinectGestureSwipeLeftToRightFrame1 frame1 = new KinectGestureSwipeLeftToRightFrame1(); KinectGestureSwipeLeftToRightFrame2 frame2 = new KinectGestureSwipeLeftToRightFrame2(); KinectGestureSwipeLeftToRightFrame3 frame3 = new KinectGestureSwipeLeftToRightFrame3(); IKinectGestureFrame[] gesture = new IKinectGestureFrame[3] { frame1, frame2, frame3 }; return gesture; }
/// <summary> /// Creates the frame sequence that defines the gesture. /// </summary> /// <returns>Gesture's frame sequence</returns> private IKinectGestureFrame[] CreateGestureFrames() { KinectGestureCircleLeftHandFrame1 frame1 = new KinectGestureCircleLeftHandFrame1(); KinectGestureCircleLeftHandFrame2 frame2 = new KinectGestureCircleLeftHandFrame2(); KinectGestureCircleLeftHandFrame3 frame3 = new KinectGestureCircleLeftHandFrame3(); KinectGestureCircleLeftHandFrame4 frame4 = new KinectGestureCircleLeftHandFrame4(); IKinectGestureFrame[] gesture = new IKinectGestureFrame[5] { frame1, frame2, frame3, frame4, frame1 }; return gesture; }
/// <summary> /// Creates a new KinectGesture instance. /// </summary> /// <param name="type">Type of the recognizable gesture</param> /// <param name="gestureFrames">Sequence of frames that represent the gesture</param> public KinectGesture(KinectGestureType type, IKinectGestureFrame[] gestureFrames) { this.gestureType = type; this.gestureFrames = gestureFrames; this.currentFrameIndex = 0; this.currentFrameCount = 0; this.pausedFrameCount = 0; this.gesturePaused = false; }
/// <summary> /// Adds a new complex gesture to the gestures controller. /// </summary> /// <param name="type">Type of the gesture to be added</param> /// <param name="frames">Frames that represent the complex gesture</param> public void AddGesture(KinectGestureType type, IKinectGestureFrame[] frames) { KinectGesture gesture = new KinectGesture(type, frames); // Bind the controller "gesture recognized" event trigger to the // added gesture. gesture.KinectGestureRecognized += new EventHandler<KinectGestureEventArgs>(this.KinectGesture_KinectGestureRecognized); this.recognizableGestures.Add(gesture); }