GizmoMath::NearestPointOnLine

Find the nearest point to QueryPoint on the line defined by LineOrigin and LineDirection.