public GesturePartResult CheckGesture(Skeleton skeleton) { var j = skeleton.Joints; if (KozakiewiczPositions.ElbowsBeneathShoulders(skeleton)) { // right hand still down // left hand "on" right elbow if (j[JointType.HandRight].Position.Y < j[JointType.ElbowRight].Position.Y && KozakiewiczPositions.LeftHandOnRightElbow(skeleton)) { return(GesturePartResult.Succeed); } return(GesturePartResult.Pausing); } return(GesturePartResult.Fail); }
public GesturePartResult CheckGesture(Skeleton skeleton) { var j = skeleton.Joints; if (KozakiewiczPositions.ElbowsBeneathShoulders(skeleton)) { // left hand still "on" right elbow // right hand up "on" right shoulder if (KozakiewiczPositions.LeftHandOnRightElbow(skeleton) && 0.10 >= Math.Abs(j[JointType.WristRight].Position.X - j[JointType.ShoulderRight].Position.X) && 0.10 >= Math.Abs(j[JointType.WristRight].Position.Y - j[JointType.ShoulderRight].Position.Y) && j[JointType.ShoulderRight].Position.Z - j[JointType.WristRight].Position.Z <= 0.3) { return(GesturePartResult.Succeed); } return(GesturePartResult.Pausing); } return(GesturePartResult.Fail); }