Kinetique.GestureRecogniser.ProcessGesture C# (CSharp) Method

ProcessGesture() private method

private ProcessGesture ( Microsoft.Kinect.Joint head, Microsoft.Kinect.Joint rightHand, Microsoft.Kinect.Joint leftHand, Microsoft.Kinect.Joint chest ) : void
head Microsoft.Kinect.Joint
rightHand Microsoft.Kinect.Joint
leftHand Microsoft.Kinect.Joint
chest Microsoft.Kinect.Joint
return void
        private void ProcessGesture(Joint head, Joint rightHand, Joint leftHand,  Joint chest)
        {
            // Raise your left hand above your head and right hand to the right to activate right gesture
            if ((leftHand.Position.X < head.Position.X - 0.45) && (rightHand.Position.Y > head.Position.Y + 0.2))
            {
                if (!isBackGestureActive && !isLeftGestureActive && !isSwipeLeftGestureActive && !isSwipeRightGestureActive && !isForwardGestureActive && !isRightGestureActive)
                {
                    isLeftGestureActive = true;
                    //System.Windows.Forms.SendKeys.SendWait("{Left}");
                    KinectMainController.gestureListener.gestureOccurs(new LeftGesture());
                    Console.WriteLine("left");
                }
            }
            else
            {
                isLeftGestureActive = false;
            }
            // Raise your right hand above your head and left hand to the left to activate right gesture
            if ((rightHand.Position.X > head.Position.X + 0.45) && (leftHand.Position.Y > head.Position.Y + 0.2))
            {
                if (!isBackGestureActive && !isLeftGestureActive && !isSwipeLeftGestureActive && !isSwipeRightGestureActive && !isForwardGestureActive && !isRightGestureActive)
                {
                    isRightGestureActive = true;
                    //System.Windows.Forms.SendKeys.SendWait("{Right}");
                    KinectMainController.gestureListener.gestureOccurs(new RightGesture());
                    Console.WriteLine("right");
                }
            }
            else
            {
                isRightGestureActive = false;
            }
            // Raise your left hand above your head and push right hand foward to activate forward gesture
            if ((rightHand.Position.Z < head.Position.Z - 0.4) && (leftHand.Position.Y > head.Position.Y+0.2))
            {
                if (!isBackGestureActive && !isLeftGestureActive && !isSwipeLeftGestureActive && !isSwipeRightGestureActive && !isForwardGestureActive && !isRightGestureActive)
                {
                    isForwardGestureActive = true;
                    //System.Windows.Forms.SendKeys.SendWait("{Up}");
                    KinectMainController.gestureListener.gestureOccurs(new UpGesture());
                    Console.WriteLine("up");
                }
            }
            else
            {
                isForwardGestureActive = false;
            }
            // Raise your right hand above your head and push left hand forward to activate back gesture
            if ((leftHand.Position.Z < head.Position.Z - 0.4) && (rightHand.Position.Y > head.Position.Y + 0.2) )
            {
                if (!isBackGestureActive && !isLeftGestureActive && !isSwipeLeftGestureActive && !isSwipeRightGestureActive && !isForwardGestureActive && !isRightGestureActive)
               {
                    isBackGestureActive = true;
                    //System.Windows.Forms.SendKeys.SendWait("{Down}");
                    KinectMainController.gestureListener.gestureOccurs(new DownGesture());
                    Console.WriteLine("down");
                }
            }
            else
            {
                isBackGestureActive = false;
            }

            if ((rightHand.Position.Z < head.Position.Z - 0.18) && (rightHand.Position.X < chest.Position.X + 0.19) && (rightHand.Position.X > chest.Position.X - 0.19) && (rightHand.Position.Y < chest.Position.Y + 0.19) && (rightHand.Position.Y > chest.Position.Y - 0.19) && (leftHand.Position.X < head.Position.X - 0.45))
            {
                if (!isBackGestureActive && !isLeftGestureActive && !isSwipeLeftGestureActive && !isSwipeRightGestureActive && !isForwardGestureActive && !isRightGestureActive)
                {
                    isSwipeLeftGestureActive = true;
                    KinectMainController.gestureListener.gestureOccurs(new SwLeftGesture());
                    Console.WriteLine("Left Switch");
                }
            }
            else
            {
                isSwipeLeftGestureActive = false;
            }
            if ((leftHand.Position.Z < head.Position.Z - 0.18) && (leftHand.Position.X < chest.Position.X + 0.19) && (leftHand.Position.X > chest.Position.X - 0.19) && (leftHand.Position.Y < chest.Position.Y + 0.19) && (leftHand.Position.Y > chest.Position.Y - 0.19) && (rightHand.Position.X > head.Position.X + 0.45))
            {
                if (!isBackGestureActive && !isLeftGestureActive && !isSwipeLeftGestureActive && !isSwipeRightGestureActive && !isForwardGestureActive && !isRightGestureActive)
                {
                    isSwipeRightGestureActive = true;
                    KinectMainController.gestureListener.gestureOccurs(new SwRightGesture());
                    Console.WriteLine("Right Switch");
                }
            }
            else
            {
                isSwipeRightGestureActive = false;
            }
        }