1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add 2D navigation mesh baking

Adds 2D navigation mesh baking.
This commit is contained in:
smix8
2023-08-17 18:32:30 +02:00
parent 82f6e9be5e
commit 0ee7e3102b
44 changed files with 10706 additions and 537 deletions

View File

@@ -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;