Merge pull request #57013 from Killfrra/3.x

[3.x] Backport method `get_rid` for NavigationAgent
This commit is contained in:
Rémi Verschelde 2022-01-21 18:35:19 +01:00 committed by GitHub
commit 40a348bce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View file

@ -45,6 +45,12 @@
Returns a [Vector3] in global coordinates, that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the origin of the agent's parent.
</description>
</method>
<method name="get_rid" qualifiers="const">
<return type="RID" />
<description>
Returns the object's [RID].
</description>
</method>
<method name="get_target_location" qualifiers="const">
<return type="Vector3" />
<description>

View file

@ -45,6 +45,12 @@
Returns a [Vector2] in global coordinates, that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent.
</description>
</method>
<method name="get_rid" qualifiers="const">
<return type="RID" />
<description>
Returns the object's [RID].
</description>
</method>
<method name="get_target_location" qualifiers="const">
<return type="Vector2" />
<description>

View file

@ -35,6 +35,8 @@
#include "servers/navigation_2d_server.h"
void NavigationAgent2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_rid"), &NavigationAgent2D::get_rid);
ClassDB::bind_method(D_METHOD("set_target_desired_distance", "desired_distance"), &NavigationAgent2D::set_target_desired_distance);
ClassDB::bind_method(D_METHOD("get_target_desired_distance"), &NavigationAgent2D::get_target_desired_distance);

View file

@ -35,6 +35,8 @@
#include "servers/navigation_server.h"
void NavigationAgent::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_rid"), &NavigationAgent::get_rid);
ClassDB::bind_method(D_METHOD("set_target_desired_distance", "desired_distance"), &NavigationAgent::set_target_desired_distance);
ClassDB::bind_method(D_METHOD("get_target_desired_distance"), &NavigationAgent::get_target_desired_distance);