An unofficial Box2D physics server for Godot Engine 4.0, implemented as a GDExtension.
The goal of the project is to be a drop-in solution for 2D physics in Godot 4.0. In your Godot project you can load the GDExtension, change the (advanced) project setting physics/2d/physics_engine to Box2D, and it will work with Godot's original 2D physics nodes such as RigidBody2D and StaticBody2D.
⚠ This project is a work in progress, still in a very early stage. ⚠
Runtime errors of the form Required virtual method ... must be overridden before calling reflect this unfinished state, and they hint at which functionality is still missing.
-
Clone the git repository https://github.com/rburing/physics_server_box2d, including its
box2dandgodot-cppsubmodules. -
Open a terminal application and change its working directory to the
physics_server_box2dgit repository. -
Compile
godot-cppfor the desiredtarget(template_debugortemplate_release):cd godot-cpp scons target=template_debug generate_bindings=yes -
Compile the GDExtension for the same
targetas above:cd .. scons target=template_debug generate_bindings=no
Note: The template_debug target can also be loaded in the Godot editor.
The Godot project in the demo subdirectory is an example of how to load the GDExtension.