Box3D is a 3D physics engine for games.
This uses the presets in CMakePresets.json.
cmake --preset windows then cmake --build --preset windows-releasecmake --preset linux-release then cmake --build --preset linux-releasecmake --preset macos then cmake --build --preset macos-releasecmake --preset mingw-release then cmake --build --preset mingw-releaseRun the samples app (must be in the Box3D directory).
.\build\bin\Release\samples.exe./build/bin/samples./build/bin/Release/samplesbuild_vs2026.batbuild/box3d.slnxbuild.sh from a bash shellbox3d.xcodeprojemcmake cmake -B build -DBOX3D_SAMPLES=OFFcmake --build buildBox3D uses SSE2 with WebAssembly. Define BOX3D_DISABLE_SIMD to disable SSE2.
The core library has no dependencies beyond the C runtime (and libm on Unix). Linking it
gives you the box3d::box3d target.
I recommend to use FetchContent:
include(FetchContent)
FetchContent_Declare(box3d
GIT_REPOSITORY https://github.com/erincatto/box3d.git
GIT_TAG v0.1.0)
FetchContent_MakeAvailable(box3d)
target_link_libraries(my_app PRIVATE box3d::box3d)
For a vendored copy or git submodule, point add_subdirectory at it:
add_subdirectory(extern/box3d)
target_link_libraries(my_app PRIVATE box3d::box3d)
To use a copy installed with cmake --install, find the package:
find_package(box3d 0.1 REQUIRED)
target_link_libraries(my_app PRIVATE box3d::box3d)
See docs/hello.md for a minimal first program.
The Box3D library and samples build and run on Windows, Linux, and Mac.
You will need a compiler that supports C17 to build the Box3D library.
You will need a compiler that supports C++20 to build the samples.
Box3D uses SSE2 and Neon SIMD math to improve performance. SIMD can be disabled by defining BOX3D_DISABLE_SIMD.
The user manual lives in docs/ and is built with Doxygen. Enable the BOX3D_DOCS CMake option and build the doc target.
Pull requests are currently disabled. Instead, please file an issue for bugs or feature requests. For support, please visit the Discord server.
Please file an issue or start a chat on discord. You can also use GitHub Discussions.
Box3D is developed by Erin Catto and uses the MIT license.
Support development of Box3D through Github Sponsors.
Please consider starring this repository and subscribing to my YouTube channel.
LLMs are used in the following areas:
Elsewhere all code is developed and written by me. I take responsibility for every line of code in Box2D/3D.
41 commits
C
97.6%
C++
1.7%
Box3D is a 3D physics engine for games.
This uses the presets in CMakePresets.json.
cmake --preset windows then cmake --build --preset windows-releasecmake --preset linux-release then cmake --build --preset linux-releasecmake --preset macos then cmake --build --preset macos-releasecmake --preset mingw-release then cmake --build --preset mingw-releaseRun the samples app (must be in the Box3D directory).
.\build\bin\Release\samples.exe./build/bin/samples./build/bin/Release/samplesbuild_vs2026.batbuild/box3d.slnxbuild.sh from a bash shellbox3d.xcodeprojemcmake cmake -B build -DBOX3D_SAMPLES=OFFcmake --build buildBox3D uses SSE2 with WebAssembly. Define BOX3D_DISABLE_SIMD to disable SSE2.
The core library has no dependencies beyond the C runtime (and libm on Unix). Linking it
gives you the box3d::box3d target.
I recommend to use FetchContent:
include(FetchContent)
FetchContent_Declare(box3d
GIT_REPOSITORY https://github.com/erincatto/box3d.git
GIT_TAG v0.1.0)
FetchContent_MakeAvailable(box3d)
target_link_libraries(my_app PRIVATE box3d::box3d)
For a vendored copy or git submodule, point add_subdirectory at it:
add_subdirectory(extern/box3d)
target_link_libraries(my_app PRIVATE box3d::box3d)
To use a copy installed with cmake --install, find the package:
find_package(box3d 0.1 REQUIRED)
target_link_libraries(my_app PRIVATE box3d::box3d)
See docs/hello.md for a minimal first program.
The Box3D library and samples build and run on Windows, Linux, and Mac.
You will need a compiler that supports C17 to build the Box3D library.
You will need a compiler that supports C++20 to build the samples.
Box3D uses SSE2 and Neon SIMD math to improve performance. SIMD can be disabled by defining BOX3D_DISABLE_SIMD.
The user manual lives in docs/ and is built with Doxygen. Enable the BOX3D_DOCS CMake option and build the doc target.
Pull requests are currently disabled. Instead, please file an issue for bugs or feature requests. For support, please visit the Discord server.
Please file an issue or start a chat on discord. You can also use GitHub Discussions.
Box3D is developed by Erin Catto and uses the MIT license.
Support development of Box3D through Github Sponsors.
Please consider starring this repository and subscribing to my YouTube channel.
LLMs are used in the following areas:
Elsewhere all code is developed and written by me. I take responsibility for every line of code in Box2D/3D.
41 commits
C
97.6%
C++
1.7%