diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-29 15:33:25 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-29 15:33:25 +0200 |
commit | f5f4d9bf0011f8904cadbd47bc6e53d4d59d7d96 (patch) | |
tree | 5a11f337fef41531b55fd21b96841c32376cd159 /servers | |
parent | 6991e9b43d0954018e1a82fa4cb28af42632ae92 (diff) | |
parent | a2c53b881b1a54c95036f27577ee7d9b6e583d62 (diff) |
Merge pull request #66143 from DarkKilauea/nav-queries-agent
Update NavigationAgent to use query_path
Diffstat (limited to 'servers')
4 files changed, 16 insertions, 0 deletions
diff --git a/servers/navigation/navigation_path_query_result_2d.cpp b/servers/navigation/navigation_path_query_result_2d.cpp index 23f001057b..8a55451e40 100644 --- a/servers/navigation/navigation_path_query_result_2d.cpp +++ b/servers/navigation/navigation_path_query_result_2d.cpp @@ -38,9 +38,15 @@ const Vector<Vector2> &NavigationPathQueryResult2D::get_path() const { return path; } +void NavigationPathQueryResult2D::reset() { + path.clear(); +} + void NavigationPathQueryResult2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_path", "path"), &NavigationPathQueryResult2D::set_path); ClassDB::bind_method(D_METHOD("get_path"), &NavigationPathQueryResult2D::get_path); + ClassDB::bind_method(D_METHOD("reset"), &NavigationPathQueryResult2D::reset); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR2_ARRAY, "path"), "set_path", "get_path"); } diff --git a/servers/navigation/navigation_path_query_result_2d.h b/servers/navigation/navigation_path_query_result_2d.h index c98462016e..da251ef32d 100644 --- a/servers/navigation/navigation_path_query_result_2d.h +++ b/servers/navigation/navigation_path_query_result_2d.h @@ -45,6 +45,8 @@ protected: public: void set_path(const Vector<Vector2> &p_path); const Vector<Vector2> &get_path() const; + + void reset(); }; #endif // NAVIGATION_PATH_QUERY_RESULT_2D_H diff --git a/servers/navigation/navigation_path_query_result_3d.cpp b/servers/navigation/navigation_path_query_result_3d.cpp index 8335d70c4b..1e28352995 100644 --- a/servers/navigation/navigation_path_query_result_3d.cpp +++ b/servers/navigation/navigation_path_query_result_3d.cpp @@ -38,9 +38,15 @@ const Vector<Vector3> &NavigationPathQueryResult3D::get_path() const { return path; } +void NavigationPathQueryResult3D::reset() { + path.clear(); +} + void NavigationPathQueryResult3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_path", "path"), &NavigationPathQueryResult3D::set_path); ClassDB::bind_method(D_METHOD("get_path"), &NavigationPathQueryResult3D::get_path); + ClassDB::bind_method(D_METHOD("reset"), &NavigationPathQueryResult3D::reset); + ADD_PROPERTY(PropertyInfo(Variant::PACKED_VECTOR3_ARRAY, "path"), "set_path", "get_path"); } diff --git a/servers/navigation/navigation_path_query_result_3d.h b/servers/navigation/navigation_path_query_result_3d.h index ff698c285f..fc143ac389 100644 --- a/servers/navigation/navigation_path_query_result_3d.h +++ b/servers/navigation/navigation_path_query_result_3d.h @@ -45,6 +45,8 @@ protected: public: void set_path(const Vector<Vector3> &p_path); const Vector<Vector3> &get_path() const; + + void reset(); }; #endif // NAVIGATION_PATH_QUERY_RESULT_3D_H |