public GesturePartResult CheckGesture(Skeleton skeleton) { SkeletonAnalyzer analyzer = new SkeletonAnalyzer(); analyzer.SetBodySegments(skeleton.Joints[JointType.ElbowRight], skeleton.Joints[JointType.ShoulderRight], skeleton.Joints[JointType.HipCenter]); if ((skeleton.Joints[JointType.HandRight].Position.X < skeleton.Joints[JointType.ShoulderRight].Position.X + 0.5) && (skeleton.Joints[JointType.HandRight].Position.X > skeleton.Joints[JointType.HipCenter].Position.X)&& (skeleton.Joints[JointType.HandRight].Position.X < skeleton.Joints[JointType.ShoulderRight].Position.X+0.4)) { if (analyzer.GetBodySegmentAngle(skeleton.Joints) > 10 && analyzer.GetBodySegmentAngle(skeleton.Joints) <60 && !Constants.isPunching) return GesturePartResult.Suceed; return GesturePartResult.Pausing; } else return GesturePartResult.Fail; }
public GesturePartResult CheckGesture(Skeleton skeleton) { SkeletonAnalyzer analyzer = new SkeletonAnalyzer(); analyzer.SetBodySegments(skeleton.Joints[JointType.ElbowRight], skeleton.Joints[JointType.ShoulderRight], skeleton.Joints[JointType.HipCenter]); if ((skeleton.Joints[JointType.HandRight].Position.X < skeleton.Joints[JointType.ShoulderRight].Position.X + 0.5) && (skeleton.Joints[JointType.HandRight].Position.X > skeleton.Joints[JointType.HipCenter].Position.X) && (skeleton.Joints[JointType.HandRight].Position.X < skeleton.Joints[JointType.ShoulderRight].Position.X + 0.4)) { if (analyzer.GetBodySegmentAngle(skeleton.Joints) > 10 && analyzer.GetBodySegmentAngle(skeleton.Joints) < 60 && !Constants.isPunching) { return(GesturePartResult.Suceed); } return(GesturePartResult.Pausing); } else { return(GesturePartResult.Fail); } }
public GesturePartResult CheckGesture(Skeleton skeleton) { SkeletonAnalyzer analyzer = new SkeletonAnalyzer(); analyzer.SetBodySegments(skeleton.Joints[JointType.HandLeft], skeleton.Joints[JointType.ElbowLeft], skeleton.Joints[JointType.ShoulderLeft]); if (skeleton.Joints[JointType.HandLeft].Position.Z < skeleton.Joints[JointType.ElbowLeft].Position.Z) { // Hands between shoulder and hip if ((skeleton.Joints[JointType.HandLeft].Position.Y > skeleton.Joints[JointType.HandRight].Position.Y)&& analyzer.GetBodySegmentAngle(skeleton.Joints) >160) { return GesturePartResult.Suceed; } return GesturePartResult.Pausing; } return GesturePartResult.Fail; }
public GesturePartResult CheckGesture(Skeleton skeleton) { SkeletonAnalyzer analyzer = new SkeletonAnalyzer(); analyzer.SetBodySegments(skeleton.Joints[JointType.HandLeft], skeleton.Joints[JointType.ElbowLeft], skeleton.Joints[JointType.ShoulderLeft]); if (skeleton.Joints[JointType.HandLeft].Position.Z < skeleton.Joints[JointType.ElbowLeft].Position.Z) { // Hands between shoulder and hip if ((skeleton.Joints[JointType.HandLeft].Position.Y > skeleton.Joints[JointType.HandRight].Position.Y) && analyzer.GetBodySegmentAngle(skeleton.Joints) > 160) { return(GesturePartResult.Suceed); } return(GesturePartResult.Pausing); } return(GesturePartResult.Fail); }