Function
The point to measure from.
The rectangle to measure against.
A new point on the rectangle's outline; neither argument is modified.
Find the point on a rectangle's outline nearest to a given point. Unlike closestPointOnAabb, a point inside the rectangle is pushed out to the nearest edge rather than returned as-is, so the result always sits on the border.
closestPointOnEdge