private void TrackForeMove(Body body, Joint head, Joint handLeft, Joint handRight) { CameraSpacePoint newPoint = default(CameraSpacePoint); if (IsHandInInitialGesture(body.HandRightState)) { newPoint = handRight.Position; Debug.WriteLine("Force hand: Right"); } else if (IsHandInInitialGesture(body.HandLeftState)) { newPoint = handLeft.Position; Debug.WriteLine("Force hand: Left"); } if (newPoint != default(CameraSpacePoint)) { var distance = CoordinateHelper.GetDistance(newPoint, _lastHandPosition); if (_handTrackedCount > 0 && distance > 0.15F) { Debug.WriteLine("oldPoint: x={0} y={1} z={2}", _lastHandPosition.X, _lastHandPosition.Y, _lastHandPosition.Z); Debug.WriteLine("newPoint: x={0} y={1} z={2}", newPoint.X, newPoint.Y, newPoint.Z); ResetTrackingCounters(1); Debug.WriteLine("Reseted in order ot distance: {0}", distance); } _lastHeadPosition = _lastHeadPosition.GetAccumulatedAvarage(head.Position, ref _headTrackedCount); _lastHandPosition = _lastHandPosition.GetAccumulatedAvarage(newPoint, ref _handTrackedCount); Debug.WriteLine("Forse tracked: {0} Frame: {1}", _handTrackedCount, _frameCount); } if (CanFireForesMove()) { var handPosition = _lastHandPosition; var headPosition = _lastHeadPosition; // ZY Projection var headZY = headPosition.GetProjectionForZY(); var handZY = handPosition.GetProjectionForZY(); var y = CoordinateHelper.FindPointProjection(headZY, handZY); // XZ Projection var x = CoordinateHelper.FindPointProjection(headPosition.GetProjectionForXZ(), handPosition.GetProjectionForXZ(), y); var point = new Point { X = x, Y = y }; ForceApplying.SafeRise(this, point); Debug.WriteLine("Force Point: x={0} y={1}", point.X, point.Y); ResetTrackingCounters(); } else if (CanFireForesDispel()) { ForceDispel.SafeRise(this); ResetTrackingCounters(); } }