diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-01-10 07:14:16 +0100 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-05-10 05:01:58 +0200 |
commit | a6ac305f967a272c35f984b046517629a401b688 (patch) | |
tree | 89726a7a0a28c4987619371776a4a6ed009f0454 /main | |
parent | 7f4687562de6025d28eca30d6e24b03050345012 (diff) | |
download | redot-engine-a6ac305f967a272c35f984b046517629a401b688.tar.gz |
Rework Navigation Avoidance
Rework Navigation Avoidance.
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/main/main.cpp b/main/main.cpp index b657fc61bb..baa8692a87 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -209,6 +209,7 @@ static bool use_debug_profiler = false; static bool debug_collisions = false; static bool debug_paths = false; static bool debug_navigation = false; +static bool debug_avoidance = false; #endif static int frame_delay = 0; static bool disable_render_loop = false; @@ -456,6 +457,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --debug-collisions Show collision shapes when running the scene.\n"); OS::get_singleton()->print(" --debug-paths Show path lines when running the scene.\n"); OS::get_singleton()->print(" --debug-navigation Show navigation polygons when running the scene.\n"); + OS::get_singleton()->print(" --debug-avoidance Show navigation polygons when running the scene.\n"); OS::get_singleton()->print(" --debug-stringnames Print all StringName allocations to stdout when the engine quits.\n"); #endif OS::get_singleton()->print(" --frame-delay <ms> Simulate high CPU load (delay each frame by <ms> milliseconds).\n"); @@ -1308,6 +1310,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph debug_paths = true; } else if (I->get() == "--debug-navigation") { debug_navigation = true; + } else if (I->get() == "--debug-avoidance") { + debug_avoidance = true; } else if (I->get() == "--debug-stringnames") { StringName::set_debug_stringnames(true); #endif @@ -2846,8 +2850,19 @@ bool Main::start() { } if (debug_navigation) { sml->set_debug_navigation_hint(true); + } + if (debug_avoidance) { + sml->set_debug_avoidance_hint(true); + } + if (debug_navigation || debug_avoidance) { NavigationServer3D::get_singleton()->set_active(true); NavigationServer3D::get_singleton()->set_debug_enabled(true); + if (debug_navigation) { + NavigationServer3D::get_singleton()->set_debug_navigation_enabled(true); + } + if (debug_avoidance) { + NavigationServer3D::get_singleton()->set_debug_avoidance_enabled(true); + } } #endif |