CubeGestureListener.GestureInProgress C# (CSharp) Method

GestureInProgress() public method

Invoked when a gesture is in progress.
public GestureInProgress ( long userId, int userIndex, KinectGestures.Gestures gesture, float progress, KinectInterop.JointType joint, Vector3, screenPos ) : void
userId long User ID
userIndex int User index
gesture KinectGestures.Gestures Gesture type
progress float Gesture progress [0..1]
joint KinectInterop.JointType Joint type
screenPos Vector3, Normalized viewport position
return void
	public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture, 
	                              float progress, KinectInterop.JointType joint, Vector3 screenPos)
	{
        // the gestures are allowed for the primary user only
        sGestureText = gesture + " detected";


        if (userIndex != playerIndex)
			return;

	
		 if((gesture == KinectGestures.Gestures.Wheel || gesture == KinectGestures.Gestures.LeanLeft || 
		         gesture == KinectGestures.Gestures.LeanRight || gesture == KinectGestures.Gestures.LeanForward ||
                 gesture == KinectGestures.Gestures.LeanBack) && progress > 0.01f)
		{
			if(gestureInfo != null)
			{
                
				sGestureText = string.Format ("{0} - {1:F0} degrees", gesture, screenPos.z);
				gestureInfo.text = sGestureText;

                if (gesture == KinectGestures.Gestures.LeanLeft && screenPos.z > detectSense)
                {
                    LeanLeft = true;
                } else
                {
                    LeanLeft = false;
                }
                    
                if (gesture == KinectGestures.Gestures.LeanRight && screenPos.z > detectSense)
                {
                    LeanRight = true;
                }else
                {
                    LeanRight = false;
                }

                if (gesture == KinectGestures.Gestures.LeanForward && screenPos.z > detectSense)
                {
                    LeanForward = true;
                }
                else
                {
                    LeanForward = false;
                }


                if (gesture == KinectGestures.Gestures.LeanBack && screenPos.z > detectSense + 10)
                {
                    LeanBack = true;
                }
                else
                {
                    LeanBack = false;
                }

                progressDisplayed = true;
				progressGestureTime = Time.realtimeSinceStartup;
			}
		}
	
	}