AStar: Make get_closest_point() deterministic for equidistant points

Closes godotengine/godot-docs#3667.
Supersedes #39405.
This commit is contained in:
Rémi Verschelde
2020-06-09 10:26:21 +02:00
parent 201d5a7fc5
commit 187ba4c5a8
3 changed files with 13 additions and 7 deletions

View File

@ -114,7 +114,8 @@
<argument index="1" name="include_disabled" type="bool" default="false">
</argument>
<description>
Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool.
Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns [code]-1[/code] if there are no points in the points pool.
[b]Note:[/b] If several points are the closest to [code]to_position[/code], the one with the smallest ID will be returned, ensuring a deterministic result.
</description>
</method>
<method name="get_closest_position_in_segment" qualifiers="const">