diff options
| author | Ricardo Buring <ricardo.buring@gmail.com> | 2024-08-07 16:20:21 +0200 |
|---|---|---|
| committer | Ricardo Buring <ricardo.buring@gmail.com> | 2024-09-21 21:19:45 +0200 |
| commit | 0333648cea0483edce0131722789b54d4daa7d5a (patch) | |
| tree | edf63916f4ca196d097c66c52d04432e4a94bc44 /tests | |
| parent | e4e024ab88efe74677769395886bc1b09eccbac7 (diff) | |
| download | redot-engine-0333648cea0483edce0131722789b54d4daa7d5a.tar.gz | |
Move Godot Physics 3D into a module; add dummy 3D physics server
If the module is enabled (default), 3D physics works as it did before.
If the module is disabled and no other 3D physics server is registered
(via a module or GDExtension), then we fall back to a dummy
implementation which effectively disables 3D physics functionality (and
a warning is printed).
The dummy 3D physics server can also be selected explicitly, in which
case no warning is printed.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 949e4f0b33..3c184ccc5d 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -176,6 +176,7 @@ #include "servers/physics_server_2d.h" #ifndef _3D_DISABLED #include "servers/physics_server_3d.h" +#include "servers/physics_server_3d_dummy.h" #endif // _3D_DISABLED #include "servers/rendering/rendering_server_default.h" @@ -290,6 +291,9 @@ struct GodotTestCaseListener : public doctest::IReporter { #ifndef _3D_DISABLED physics_server_3d = PhysicsServer3DManager::get_singleton()->new_default_server(); + if (!physics_server_3d) { + physics_server_3d = memnew(PhysicsServer3DDummy); + } physics_server_3d->init(); #endif // _3D_DISABLED |
