Skip to content

Commit

Permalink
backported method get_rid for NavigationAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
Killfrra committed Jan 20, 2022
1 parent 4075866 commit 1c3d3af
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/classes/NavigationAgent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 6 additions & 0 deletions doc/classes/NavigationAgent2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions scene/2d/navigation_agent_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions scene/3d/navigation_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1c3d3af

Please sign in to comment.