diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index b90c90cad..0d199cf46 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -98,7 +98,7 @@ void NavigationAgent2D::_bind_methods() { ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent2D::distance_to_target); ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent2D::get_current_navigation_result); - ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent2D::get_current_navigation_path); + ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent2D::get_current_navigation_path_bind); ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent2D::get_current_navigation_path_index); ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent2D::is_target_reached); ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent2D::is_target_reachable); @@ -600,6 +600,10 @@ const Vector &NavigationAgent2D::get_current_navigation_path() const { return navigation_result->get_path(); } +Vector NavigationAgent2D::get_current_navigation_path_bind() const { + return navigation_result->get_path(); +} + real_t NavigationAgent2D::distance_to_target() const { ERR_FAIL_COND_V(agent_parent == nullptr, 0.0); return agent_parent->get_global_transform().get_origin().distance_to(target_position); diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index 0f81b6d61..275b3d839 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -198,6 +198,7 @@ public: Ref get_current_navigation_result() const; const Vector &get_current_navigation_path() const; + Vector get_current_navigation_path_bind() const; int get_current_navigation_path_index() const { return nav_path_index; diff --git a/scene/2d/navigation_obstacle_2d.cpp b/scene/2d/navigation_obstacle_2d.cpp index 8e029e6e2..49937d30d 100644 --- a/scene/2d/navigation_obstacle_2d.cpp +++ b/scene/2d/navigation_obstacle_2d.cpp @@ -52,7 +52,7 @@ void NavigationObstacle2D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle2D::get_velocity); ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle2D::set_vertices); - ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle2D::get_vertices); + ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle2D::get_vertices_bind); ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle2D::set_avoidance_layers); ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle2D::get_avoidance_layers); diff --git a/scene/2d/navigation_obstacle_2d.h b/scene/2d/navigation_obstacle_2d.h index 1097373dc..d3377f915 100644 --- a/scene/2d/navigation_obstacle_2d.h +++ b/scene/2d/navigation_obstacle_2d.h @@ -93,6 +93,7 @@ public: void set_vertices(const Vector &p_vertices); const Vector &get_vertices() const { return vertices; }; + Vector get_vertices_bind() const { return vertices; }; void set_avoidance_layers(uint32_t p_layers); uint32_t get_avoidance_layers() const; diff --git a/scene/3d/navigation_agent.cpp b/scene/3d/navigation_agent.cpp index 4a45e6c40..aef3a54a2 100644 --- a/scene/3d/navigation_agent.cpp +++ b/scene/3d/navigation_agent.cpp @@ -111,7 +111,7 @@ void NavigationAgent::_bind_methods() { ClassDB::bind_method(D_METHOD("distance_to_target"), &NavigationAgent::distance_to_target); ClassDB::bind_method(D_METHOD("get_current_navigation_result"), &NavigationAgent::get_current_navigation_result); - ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent::get_current_navigation_path); + ClassDB::bind_method(D_METHOD("get_current_navigation_path"), &NavigationAgent::get_current_navigation_path_bind); ClassDB::bind_method(D_METHOD("get_current_navigation_path_index"), &NavigationAgent::get_current_navigation_path_index); ClassDB::bind_method(D_METHOD("is_target_reached"), &NavigationAgent::is_target_reached); ClassDB::bind_method(D_METHOD("is_target_reachable"), &NavigationAgent::is_target_reachable); @@ -577,6 +577,10 @@ const Vector &NavigationAgent::get_current_navigation_path() const { return navigation_result->get_path(); } +Vector NavigationAgent::get_current_navigation_path_bind() const { + return navigation_result->get_path(); +} + real_t NavigationAgent::distance_to_target() const { ERR_FAIL_COND_V_MSG(agent_parent == nullptr, 0.0, "The agent has no parent."); return agent_parent->get_global_transform().origin.distance_to(target_position); diff --git a/scene/3d/navigation_agent.h b/scene/3d/navigation_agent.h index 6471f1ce4..5ca880aae 100644 --- a/scene/3d/navigation_agent.h +++ b/scene/3d/navigation_agent.h @@ -32,6 +32,7 @@ /*************************************************************************/ #include "core/containers/vector.h" + #include "scene/main/node.h" class Spatial; @@ -222,6 +223,7 @@ public: Ref get_current_navigation_result() const; const Vector &get_current_navigation_path() const; + Vector get_current_navigation_path_bind() const; int get_current_navigation_path_index() const { return nav_path_index; diff --git a/scene/3d/navigation_obstacle.cpp b/scene/3d/navigation_obstacle.cpp index e8bc0096a..9fdb2c260 100644 --- a/scene/3d/navigation_obstacle.cpp +++ b/scene/3d/navigation_obstacle.cpp @@ -62,7 +62,7 @@ void NavigationObstacle::_bind_methods() { ClassDB::bind_method(D_METHOD("get_velocity"), &NavigationObstacle::get_velocity); ClassDB::bind_method(D_METHOD("set_vertices", "vertices"), &NavigationObstacle::set_vertices); - ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle::get_vertices); + ClassDB::bind_method(D_METHOD("get_vertices"), &NavigationObstacle::get_vertices_bind); ClassDB::bind_method(D_METHOD("set_avoidance_layers", "layers"), &NavigationObstacle::set_avoidance_layers); ClassDB::bind_method(D_METHOD("get_avoidance_layers"), &NavigationObstacle::get_avoidance_layers); diff --git a/scene/3d/navigation_obstacle.h b/scene/3d/navigation_obstacle.h index 2e16dcf87..4cef27b00 100644 --- a/scene/3d/navigation_obstacle.h +++ b/scene/3d/navigation_obstacle.h @@ -106,6 +106,7 @@ public: void set_vertices(const Vector &p_vertices); const Vector &get_vertices() const { return vertices; }; + Vector get_vertices_bind() const { return vertices; }; void set_avoidance_layers(uint32_t p_layers); uint32_t get_avoidance_layers() const; diff --git a/servers/navigation/navigation_path_query_result_2d.cpp b/servers/navigation/navigation_path_query_result_2d.cpp index 180cff866..fd27418b3 100644 --- a/servers/navigation/navigation_path_query_result_2d.cpp +++ b/servers/navigation/navigation_path_query_result_2d.cpp @@ -34,7 +34,7 @@ void NavigationPathQueryResult2D::set_path(const Vector &p_path) { path = p_path; } -const Vector &NavigationPathQueryResult2D::get_path() const { +Vector NavigationPathQueryResult2D::get_path() const { return path; } @@ -42,7 +42,7 @@ void NavigationPathQueryResult2D::set_path_types(const Vector &p_path_t path_types = p_path_types; } -const Vector &NavigationPathQueryResult2D::get_path_types() const { +Vector NavigationPathQueryResult2D::get_path_types() const { return path_types; } @@ -58,7 +58,7 @@ void NavigationPathQueryResult2D::set_path_owner_ids(const Vector &p_p path_owner_ids = p_path_owner_ids; } -const Vector &NavigationPathQueryResult2D::get_path_owner_ids() const { +Vector NavigationPathQueryResult2D::get_path_owner_ids() const { return path_owner_ids; } diff --git a/servers/navigation/navigation_path_query_result_2d.h b/servers/navigation/navigation_path_query_result_2d.h index 5f4f348bb..a2d431b62 100644 --- a/servers/navigation/navigation_path_query_result_2d.h +++ b/servers/navigation/navigation_path_query_result_2d.h @@ -52,16 +52,16 @@ public: }; void set_path(const Vector &p_path); - const Vector &get_path() const; + Vector get_path() const; void set_path_types(const Vector &p_path_types); - const Vector &get_path_types() const; + Vector get_path_types() const; void set_path_rids(const Array &p_path_rids); Array get_path_rids() const; void set_path_owner_ids(const Vector &p_path_owner_ids); - const Vector &get_path_owner_ids() const; + Vector get_path_owner_ids() const; void set_path_owner_ids_bind(const Array p_path_owner_ids); Array get_path_owner_ids_bind() const; diff --git a/servers/navigation/navigation_path_query_result_3d.cpp b/servers/navigation/navigation_path_query_result_3d.cpp index 741293bbd..caf08f21a 100644 --- a/servers/navigation/navigation_path_query_result_3d.cpp +++ b/servers/navigation/navigation_path_query_result_3d.cpp @@ -34,7 +34,7 @@ void NavigationPathQueryResult3D::set_path(const Vector &p_path) { path = p_path; } -const Vector &NavigationPathQueryResult3D::get_path() const { +Vector NavigationPathQueryResult3D::get_path() const { return path; } @@ -42,7 +42,7 @@ void NavigationPathQueryResult3D::set_path_types(const Vector &p_path_types path_types = p_path_types; } -const Vector &NavigationPathQueryResult3D::get_path_types() const { +Vector NavigationPathQueryResult3D::get_path_types() const { return path_types; } @@ -58,7 +58,7 @@ void NavigationPathQueryResult3D::set_path_owner_ids(const Vector &p_p path_owner_ids = p_path_owner_ids; } -const Vector &NavigationPathQueryResult3D::get_path_owner_ids() const { +Vector NavigationPathQueryResult3D::get_path_owner_ids() const { return path_owner_ids; } diff --git a/servers/navigation/navigation_path_query_result_3d.h b/servers/navigation/navigation_path_query_result_3d.h index cc19ece80..8e49d3e1d 100644 --- a/servers/navigation/navigation_path_query_result_3d.h +++ b/servers/navigation/navigation_path_query_result_3d.h @@ -53,16 +53,16 @@ public: }; void set_path(const Vector &p_path); - const Vector &get_path() const; + Vector get_path() const; void set_path_types(const Vector &p_path_types); - const Vector &get_path_types() const; + Vector get_path_types() const; void set_path_rids(const Array &p_path_rids); Array get_path_rids() const; void set_path_owner_ids(const Vector &p_path_owner_ids); - const Vector &get_path_owner_ids() const; + Vector get_path_owner_ids() const; void set_path_owner_ids_bind(const Array p_path_owner_ids); Array get_path_owner_ids_bind() const;