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;
}
}
}