From 1c3d3af6efbe6983a25d414fae45d900e7a46170 Mon Sep 17 00:00:00 2001 From: Mak Kma Date: Thu, 20 Jan 2022 22:38:20 +0300 Subject: [PATCH] backported method get_rid for NavigationAgent --- doc/classes/NavigationAgent.xml | 6 ++++++ doc/classes/NavigationAgent2D.xml | 6 ++++++ scene/2d/navigation_agent_2d.cpp | 2 ++ scene/3d/navigation_agent.cpp | 2 ++ 4 files changed, 16 insertions(+) diff --git a/doc/classes/NavigationAgent.xml b/doc/classes/NavigationAgent.xml index 1ba47c71941f..1857c15b224a 100644 --- a/doc/classes/NavigationAgent.xml +++ b/doc/classes/NavigationAgent.xml @@ -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. + + + + Returns the object's [RID]. + + diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index 0ac9841d2741..251c33f56e9c 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -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. + + + + Returns the object's [RID]. + + diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index 55e951feba0e..4d7b5d8967e5 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -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); diff --git a/scene/3d/navigation_agent.cpp b/scene/3d/navigation_agent.cpp index b37d734b2fc7..6baf7d078c53 100644 --- a/scene/3d/navigation_agent.cpp +++ b/scene/3d/navigation_agent.cpp @@ -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);