private void ComputeH() { HpxS = new Point(hStart.X, hStart.Y); HpxE = new Point(hEnd.X, hEnd.Y); Hcm = SkeletonMath.Distance(handLeft, handRight) * 100f; HComputed = true; }
private void GetMainHand() { if (skeleton != null) { lock (skeleton) { mainHand = new SkeletonPoint(); bodyCenter = skeleton.Joints[JointType.HipCenter].Position; float l = SkeletonMath.Distance(skeleton.Joints[JointType.HandLeft].Position, bodyCenter); float r = SkeletonMath.Distance(skeleton.Joints[JointType.HandRight].Position, bodyCenter); if (l > r) { mainHand = skeleton.Joints[JointType.HandLeft].Position; } else { mainHand = skeleton.Joints[JointType.HandRight].Position; } } } }