diff options
author | smix8 <52464204+smix8@users.noreply.github.com> | 2023-08-17 18:32:30 +0200 |
---|---|---|
committer | smix8 <52464204+smix8@users.noreply.github.com> | 2023-09-25 19:48:14 +0200 |
commit | 0ee7e3102b6072d2f5a9d157c8afdb99e13624e6 (patch) | |
tree | 80e45613d1cdc8a850d6ceb1f9bce7f63d0db94e /modules/navigation/godot_navigation_server.cpp | |
parent | 82f6e9be5ea06bfef1adb315f15a409939b4a100 (diff) | |
download | redot-engine-0ee7e3102b6072d2f5a9d157c8afdb99e13624e6.tar.gz |
Add 2D navigation mesh baking
Adds 2D navigation mesh baking.
Diffstat (limited to 'modules/navigation/godot_navigation_server.cpp')
-rw-r--r-- | modules/navigation/godot_navigation_server.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index 9162fcf171..32482e0c9d 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -1086,6 +1086,14 @@ void GodotNavigationServer::map_force_update(RID p_map) { map->sync(); } +void GodotNavigationServer::sync() { +#ifndef _3D_DISABLED + if (navmesh_generator_3d) { + navmesh_generator_3d->sync(); + } +#endif // _3D_DISABLED +} + void GodotNavigationServer::process(real_t p_delta_time) { flush_queries(); @@ -1093,16 +1101,6 @@ void GodotNavigationServer::process(real_t p_delta_time) { return; } -#ifndef _3D_DISABLED - // Sync finished navmesh bakes before doing NavMap updates. - if (navmesh_generator_3d) { - navmesh_generator_3d->sync(); - // Finished bakes emit callbacks and users might have reacted to those. - // Flush queue again so users do not have to wait for the next sync. - flush_queries(); - } -#endif // _3D_DISABLED - int _new_pm_region_count = 0; int _new_pm_agent_count = 0; int _new_pm_link_count = 0; |