diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-01-16 17:45:03 +0100 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-01-31 18:27:35 +0100 |
commit | 0ab764e84bc9d7f21292f954fb2be215377a7276 (patch) | |
tree | 5fbcee4056894c246ba9e61ca316d2bd497bda62 /scene/2d/navigation_agent_2d.h | |
parent | 2b710bc336a02ace95eb0588f3b0744923faf004 (diff) |
Add NavigationAgent Path Debug Visualization
Adds path debug visuals for NavigationAgent2D, NavigationAgent3D and NavigationServer.
Diffstat (limited to 'scene/2d/navigation_agent_2d.h')
-rw-r--r-- | scene/2d/navigation_agent_2d.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index 9787bb1bdb..8f4a373327 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -74,6 +74,20 @@ class NavigationAgent2D : public Node { // No initialized on purpose uint32_t update_frame_id = 0; +#ifdef DEBUG_ENABLED + bool debug_enabled = false; + bool debug_path_dirty = true; + RID debug_path_instance; + float debug_path_custom_point_size = 4.0; + float debug_path_custom_line_width = 1.0; + bool debug_use_custom = false; + Color debug_path_custom_color = Color(1.0, 1.0, 1.0, 1.0); + +private: + void _navigation_debug_changed(); + void _update_debug_path(); +#endif // DEBUG_ENABLED + protected: static void _bind_methods(); void _notification(int p_what); @@ -169,6 +183,23 @@ public: PackedStringArray get_configuration_warnings() const override; +#ifdef DEBUG_ENABLED + void set_debug_enabled(bool p_enabled); + bool get_debug_enabled() const; + + void set_debug_use_custom(bool p_enabled); + bool get_debug_use_custom() const; + + void set_debug_path_custom_color(Color p_color); + Color get_debug_path_custom_color() const; + + void set_debug_path_custom_point_size(float p_point_size); + float get_debug_path_custom_point_size() const; + + void set_debug_path_custom_line_width(float p_line_width); + float get_debug_path_custom_line_width() const; +#endif // DEBUG_ENABLED + private: void update_navigation(); void _request_repath(); |