Function GeometrySingleton.getClosestPointToSegment2d

Returns the 2D point on the 2D segment (s1, s2) that is closest to point. The returned point will always be inside the specified segment.

Vector2 getClosestPointToSegment2d (
  const(Vector2) point,
  const(Vector2) s1,
  const(Vector2) s2
) nothrow @nogc;