Rename distanceToSegment to distanceSqToSegment.
Line-picking : we only do the test in local space.
Use the optionalTarget for Ray.closestPointToPoint.