diff --git a/modules/navigation/pandemonium_navigation_2d_server.cpp b/modules/navigation/pandemonium_navigation_2d_server.cpp index 512681ca6..f3dd123bb 100644 --- a/modules/navigation/pandemonium_navigation_2d_server.cpp +++ b/modules/navigation/pandemonium_navigation_2d_server.cpp @@ -320,7 +320,7 @@ NavigationUtilities::PathQueryResult2D PandemoniumNavigation2DServer::_query_pat NavigationUtilities::PathQueryResult res = NavigationServer::get_singleton()->_query_path(params); NavigationUtilities::PathQueryResult2D resf; - resf.path = poolvector_v3_to_v2(res.path); + resf.path = vector_v3_to_v2(res.path); resf.path_types = res.path_types; resf.path_rids = res.path_rids; resf.path_owner_ids = res.path_owner_ids; diff --git a/modules/navigation/pandemonium_navigation_server.cpp b/modules/navigation/pandemonium_navigation_server.cpp index 6fe0b6fb8..e8b871e33 100644 --- a/modules/navigation/pandemonium_navigation_server.cpp +++ b/modules/navigation/pandemonium_navigation_server.cpp @@ -881,8 +881,7 @@ NavigationUtilities::PathQueryResult PandemoniumNavigationServer::_query_path(co r_query_result.path.resize(path.size()); - PoolVector3Array::Write w = r_query_result.path.write(); - Vector3 *wptr = w.ptr(); + Vector3 *wptr = r_query_result.path.ptrw(); const Vector3 *pptr = path.ptr(); for (int i = 0; i < path.size(); ++i) { diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index 3e3643c46..2cb12a669 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -440,7 +440,7 @@ Vector2 NavigationAgent2D::get_target_position() const { Vector2 NavigationAgent2D::get_next_position() { update_navigation(); - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { ERR_FAIL_COND_V(agent_parent == nullptr, Vector2()); return agent_parent->get_global_transform().get_origin(); @@ -449,7 +449,7 @@ Vector2 NavigationAgent2D::get_next_position() { } } -const PoolVector &NavigationAgent2D::get_nav_path() const { +const Vector &NavigationAgent2D::get_nav_path() const { return navigation_result->get_path(); } @@ -474,7 +474,7 @@ bool NavigationAgent2D::is_navigation_finished() { Vector2 NavigationAgent2D::get_final_position() { update_navigation(); - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { return Vector2(); } @@ -533,7 +533,7 @@ void NavigationAgent2D::update_navigation() { } else { // Check if too far from the navigation path if (nav_path_index > 0) { - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); Vector2 segment[2]; segment[0] = navigation_path[nav_path_index - 1]; @@ -577,7 +577,7 @@ void NavigationAgent2D::update_navigation() { // Check if we can advance the navigation path if (navigation_finished == false) { // Advances to the next far away position. - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); while (origin.distance_to(navigation_path[nav_path_index]) < path_desired_distance) { nav_path_index += 1; if (nav_path_index == navigation_path.size()) { @@ -682,7 +682,7 @@ void NavigationAgent2D::_update_debug_path() { RenderingServer::get_singleton()->canvas_item_set_parent(debug_path_instance, agent_parent->get_canvas()); RenderingServer::get_singleton()->canvas_item_set_visible(debug_path_instance, agent_parent->is_visible_in_tree()); - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); if (navigation_path.size() <= 1) { return; @@ -697,8 +697,7 @@ void NavigationAgent2D::_update_debug_path() { debug_path_colors.resize(navigation_path.size()); debug_path_colors.fill(debug_path_color); - //TODO - //RenderingServer::get_singleton()->canvas_item_add_polyline(debug_path_instance, navigation_path, debug_path_colors, debug_path_custom_line_width, false); + RenderingServer::get_singleton()->canvas_item_add_polyline(debug_path_instance, navigation_path, debug_path_colors, debug_path_custom_line_width, false); float point_size = Navigation2DServer::get_singleton()->get_debug_navigation_agent_path_point_size(); float half_point_size = point_size * 0.5; diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index e15750d26..9e3844138 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -164,7 +164,7 @@ public: Vector2 get_next_position(); - const PoolVector &get_nav_path() const; + const Vector &get_nav_path() const; int get_nav_path_index() const { return nav_path_index; diff --git a/scene/3d/navigation_agent.cpp b/scene/3d/navigation_agent.cpp index e99e73aa5..4dd91c5ef 100644 --- a/scene/3d/navigation_agent.cpp +++ b/scene/3d/navigation_agent.cpp @@ -457,7 +457,7 @@ Vector3 NavigationAgent::get_target_position() const { Vector3 NavigationAgent::get_next_position() { update_navigation(); - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { ERR_FAIL_COND_V_MSG(agent_parent == nullptr, Vector3(), "The agent has no parent."); return agent_parent->get_global_transform().origin; @@ -466,7 +466,7 @@ Vector3 NavigationAgent::get_next_position() { } } -const PoolVector &NavigationAgent::get_nav_path() const { +const Vector &NavigationAgent::get_nav_path() const { return navigation_result->get_path(); } @@ -491,7 +491,7 @@ bool NavigationAgent::is_navigation_finished() { Vector3 NavigationAgent::get_final_position() { update_navigation(); - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { return Vector3(); @@ -553,7 +553,7 @@ void NavigationAgent::update_navigation() { } else { // Check if too far from the navigation path if (nav_path_index > 0) { - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); Vector3 segment[2]; segment[0] = navigation_path[nav_path_index - 1]; @@ -601,7 +601,7 @@ void NavigationAgent::update_navigation() { // Check if we can advance the navigation path if (navigation_finished == false) { // Advances to the next far away position. - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); while (origin.distance_to(navigation_path[nav_path_index] - Vector3(0, navigation_height_offset, 0)) < path_desired_distance) { nav_path_index += 1; if (nav_path_index == navigation_path.size()) { @@ -698,7 +698,7 @@ void NavigationAgent::_update_debug_path() { return; } - const PoolVector &navigation_path = navigation_result->get_path(); + const Vector &navigation_path = navigation_result->get_path(); if (navigation_path.size() <= 1) { return; diff --git a/scene/3d/navigation_agent.h b/scene/3d/navigation_agent.h index 92bb86b3d..b8372c48c 100644 --- a/scene/3d/navigation_agent.h +++ b/scene/3d/navigation_agent.h @@ -180,7 +180,7 @@ public: Vector3 get_next_position(); - const PoolVector &get_nav_path() const; + const Vector &get_nav_path() const; int get_nav_path_index() const { return nav_path_index; diff --git a/servers/navigation/navigation_path_query_result_2d.cpp b/servers/navigation/navigation_path_query_result_2d.cpp index 9910eb693..2130ac322 100644 --- a/servers/navigation/navigation_path_query_result_2d.cpp +++ b/servers/navigation/navigation_path_query_result_2d.cpp @@ -30,19 +30,19 @@ #include "navigation_path_query_result_2d.h" -void NavigationPathQueryResult2D::set_path(const PoolVector &p_path) { +void NavigationPathQueryResult2D::set_path(const Vector &p_path) { path = p_path; } -const PoolVector &NavigationPathQueryResult2D::get_path() const { +const Vector &NavigationPathQueryResult2D::get_path() const { return path; } -void NavigationPathQueryResult2D::set_path_types(const PoolVector &p_path_types) { +void NavigationPathQueryResult2D::set_path_types(const Vector &p_path_types) { path_types = p_path_types; } -const PoolVector &NavigationPathQueryResult2D::get_path_types() const { +const Vector &NavigationPathQueryResult2D::get_path_types() const { return path_types; } @@ -54,11 +54,11 @@ Array NavigationPathQueryResult2D::get_path_rids() const { return path_rids; } -void NavigationPathQueryResult2D::set_path_owner_ids(const PoolVector &p_path_owner_ids) { +void NavigationPathQueryResult2D::set_path_owner_ids(const Vector &p_path_owner_ids) { path_owner_ids = p_path_owner_ids; } -const PoolVector &NavigationPathQueryResult2D::get_path_owner_ids() const { +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 33466dcbe..cf8d5ce67 100644 --- a/servers/navigation/navigation_path_query_result_2d.h +++ b/servers/navigation/navigation_path_query_result_2d.h @@ -37,10 +37,10 @@ class NavigationPathQueryResult2D : public Reference { GDCLASS(NavigationPathQueryResult2D, Reference); - PoolVector path; - PoolVector path_types; + Vector path; + Vector path_types; Array path_rids; - PoolVector path_owner_ids; + Vector path_owner_ids; protected: static void _bind_methods(); @@ -51,17 +51,17 @@ public: PATH_SEGMENT_TYPE_LINK = 1, }; - void set_path(const PoolVector &p_path); - const PoolVector &get_path() const; + void set_path(const Vector &p_path); + const Vector &get_path() const; - void set_path_types(const PoolVector &p_path_types); - const PoolVector &get_path_types() const; + void set_path_types(const Vector &p_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 PoolVector &p_path_owner_ids); - const PoolVector &get_path_owner_ids() const; + void set_path_owner_ids(const Vector &p_path_owner_ids); + const Vector &get_path_owner_ids() const; void reset(); }; diff --git a/servers/navigation/navigation_path_query_result_3d.cpp b/servers/navigation/navigation_path_query_result_3d.cpp index c04353f4b..69f60cff7 100644 --- a/servers/navigation/navigation_path_query_result_3d.cpp +++ b/servers/navigation/navigation_path_query_result_3d.cpp @@ -30,19 +30,19 @@ #include "navigation_path_query_result_3d.h" -void NavigationPathQueryResult3D::set_path(const PoolVector &p_path) { +void NavigationPathQueryResult3D::set_path(const Vector &p_path) { path = p_path; } -const PoolVector &NavigationPathQueryResult3D::get_path() const { +const Vector &NavigationPathQueryResult3D::get_path() const { return path; } -void NavigationPathQueryResult3D::set_path_types(const PoolVector &p_path_types) { +void NavigationPathQueryResult3D::set_path_types(const Vector &p_path_types) { path_types = p_path_types; } -const PoolVector &NavigationPathQueryResult3D::get_path_types() const { +const Vector &NavigationPathQueryResult3D::get_path_types() const { return path_types; } @@ -54,11 +54,11 @@ Array NavigationPathQueryResult3D::get_path_rids() const { return path_rids; } -void NavigationPathQueryResult3D::set_path_owner_ids(const PoolVector &p_path_owner_ids) { +void NavigationPathQueryResult3D::set_path_owner_ids(const Vector &p_path_owner_ids) { path_owner_ids = p_path_owner_ids; } -const PoolVector &NavigationPathQueryResult3D::get_path_owner_ids() const { +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 ed5601696..d2ba14c30 100644 --- a/servers/navigation/navigation_path_query_result_3d.h +++ b/servers/navigation/navigation_path_query_result_3d.h @@ -38,10 +38,10 @@ class NavigationPathQueryResult3D : public Reference { GDCLASS(NavigationPathQueryResult3D, Reference); - PoolVector path; - PoolVector path_types; + Vector path; + Vector path_types; Array path_rids; - PoolVector path_owner_ids; + Vector path_owner_ids; protected: static void _bind_methods(); @@ -52,17 +52,17 @@ public: PATH_SEGMENT_TYPE_LINK = 1, }; - void set_path(const PoolVector &p_path); - const PoolVector &get_path() const; + void set_path(const Vector &p_path); + const Vector &get_path() const; - void set_path_types(const PoolVector &p_path_types); - const PoolVector &get_path_types() const; + void set_path_types(const Vector &p_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 PoolVector &p_path_owner_ids); - const PoolVector &get_path_owner_ids() const; + void set_path_owner_ids(const Vector &p_path_owner_ids); + const Vector &get_path_owner_ids() const; void reset(); }; diff --git a/servers/navigation/navigation_utilities.h b/servers/navigation/navigation_utilities.h index ccf68b4d0..12b67e501 100644 --- a/servers/navigation/navigation_utilities.h +++ b/servers/navigation/navigation_utilities.h @@ -32,9 +32,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ +#include "core/containers/rid.h" #include "core/math/vector3.h" #include "core/variant/array.h" -#include "core/containers/rid.h" #include "core/variant/variant.h" namespace NavigationUtilities { @@ -82,17 +82,17 @@ struct PathQueryParameters2D { }; struct PathQueryResult { - PoolVector3Array path; - PoolIntArray path_types; + Vector path; + Vector path_types; Array path_rids; - PoolIntArray path_owner_ids; + Vector path_owner_ids; }; struct PathQueryResult2D { - PoolVector2Array path; - PoolIntArray path_types; + Vector path; + Vector path_types; Array path_rids; - PoolIntArray path_owner_ids; + Vector path_owner_ids; }; } //namespace NavigationUtilities