godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

Curve2D.get_closest_point() incorrectly documented

Open jgodfrey opened this issue 3 years ago • 0 comments

3.4.4.stable.official

The get_closest_point() method of Curve2D seems to be incorrectly documented

URL to the documentation page

The documentation states that get_closest_point(to_point) method:

Returns the closest baked point (in curve's local space) to to_point.

However, in practice, that doesn't seem to be the case. The point returned by the call seems to be an interpolated point along the Curve2D based on the to_point argument. That is, it returns a Vector2 that's (potentially) not found in the collection of baked points.

I took a quick look at the source code for get_closest_point() and, indeed, it does not appear to explicitly return one of the baked points (though I didn't follow some of the details there).

jgodfrey avatar Jun 28 '22 20:06 jgodfrey