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

Move Godot Physics 2D into a module; add dummy 2D physics server

If the module is enabled (default), 2D physics works as it did before.

If the module is disabled and no other 2D physics server is registered
(via a module or GDExtension), then we fall back to a dummy
implementation which effectively disables 2D physics functionality (and
a warning is printed).

The dummy 2D physics server can also be selected explicitly, in which
case no warning is printed.
This commit is contained in:
Ricardo Buring
2024-08-07 21:15:17 +02:00
parent 4254946de9
commit 7c4c4b9987
47 changed files with 497 additions and 29 deletions

View File

@@ -972,7 +972,9 @@ String PhysicsServer2DManager::get_server_name(int p_id) {
}
PhysicsServer2D *PhysicsServer2DManager::new_default_server() {
ERR_FAIL_COND_V(default_server_id == -1, nullptr);
if (default_server_id == -1) {
return nullptr;
}
Variant ret;
Callable::CallError ce;
physics_2d_servers[default_server_id].create_callback.callp(nullptr, 0, ret, ce);