private void BodyManager_BodyUpdated(object sender, BodyUpdatedEventArgs e) { if (!_IsPaused && !_IsEngaged) { Joint handTipLeft = e.Body.Joints[JointType.HandTipLeft]; Joint handTipRight = e.Body.Joints[JointType.HandTipRight]; Joint spineShoulder = e.Body.Joints[JointType.SpineShoulder]; if (handTipLeft.IsTracked() && handTipRight.IsTracked() && spineShoulder.IsTracked()) { if (spineShoulder.Position.DistanceToCamera() < MaxEngagementDistance) { bool aboveShoulderLeft = handTipLeft.Position.Y - spineShoulder.Position.Y > 0; bool aboveShoulderRight = handTipRight.Position.Y - spineShoulder.Position.Y > 0; EnqueueHandPosition(e.Body.TrackingId, aboveShoulderLeft && aboveShoulderRight); bool handsHovering = AreHandsHovering(e.Body.TrackingId); if (handsHovering) { _IsEngaged = true; _CurrentTrackingId = e.Body.TrackingId; RaiseEngagedEventHandler(e.Body.TrackingId); } } } } }
private void BodyManager_BodyUpdated(object sender, BodyUpdatedEventArgs e) { }