Added utility functions to the new NavigationServer:

- Vector3 get_closest_point_to_segment(const Vector3 &p_from, const Vector3 &p_to, const bool &p_use_collision = false);
- Vector3 get_closest_point(const Vector3 &p_point);
- Vector3 get_closest_point_normal(const Vector3 &p_point);
- Object *get_closest_point_owner(const Vector3 &p_point);
This commit is contained in:
Andrea Catania
2020-02-18 17:08:34 +01:00
parent 6e64036693
commit 79fc7d7d6a
16 changed files with 372 additions and 10 deletions
+22
View File
@@ -188,6 +188,28 @@
Returns the navigation path to reach the destination from the origin, while avoiding static obstacles.
</description>
</method>
<method name="map_get_closest_point" qualifiers="const">
<return type="Vector2">
</return>
<argument index="0" name="map" type="RID">
</argument>
<argument index="1" name="point" type="Vector2">
</argument>
<description>
Returns the point closest to the provided [code]point[/code] on the navigation mesh surface.
</description>
</method>
<method name="map_get_closest_point_owner" qualifiers="const">
<return type="RID">
</return>
<argument index="0" name="map" type="RID">
</argument>
<argument index="1" name="point" type="Vector2">
</argument>
<description>
Returns the owner region RID for the point returned by [method map_get_closest_point].
</description>
</method>
<method name="map_is_active" qualifiers="const">
<return type="bool">
</return>