mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Make NavigationServer backend engine selectable
Adds engine backend selection for NavigationServers, aka allows to swap navigation module for other backend implementations.
This commit is contained in:
parent
07f4c06601
commit
419fc6e22d
13 changed files with 439 additions and 54 deletions
|
|
@ -49,13 +49,14 @@
|
|||
NavigationMeshGenerator *_nav_mesh_generator = nullptr;
|
||||
#endif // DISABLE_DEPRECATED
|
||||
|
||||
NavigationServer3D *new_navigation_server_3d() {
|
||||
static NavigationServer3D *_createGodotNavigation3DCallback() {
|
||||
return memnew(GodotNavigationServer3D);
|
||||
}
|
||||
|
||||
void initialize_navigation_3d_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
|
||||
NavigationServer3DManager::set_default_server(new_navigation_server_3d);
|
||||
NavigationServer3DManager::get_singleton()->register_server("GodotNavigation3D", callable_mp_static(_createGodotNavigation3DCallback));
|
||||
NavigationServer3DManager::get_singleton()->set_default_server("GodotNavigation3D");
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
_nav_mesh_generator = memnew(NavigationMeshGenerator);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue