GameCult fork of Box3D (erincatto/box3d) carrying the per-step contact impulse patch Ymir needs. Upstream: https://github.com/erincatto/box3d
  • C 95.1%
  • C++ 4.2%
  • CMake 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Erin Catto 7216822064
Bug fixes and minor features (#2)
- API to query compounds directly.
- Fix some uninitialized stuff (thanks MSAN).
- Fix for store impulses on overflow.
- AABB margin reduced for small shapes
- body contact recycling option
- angular threshold for contact recycling
- reduce AABB margin on smaller shapes
- fix for hull vs tri when axis aligned
- fully locked rotation uses zero inverse inertia
2026-05-12 15:24:20 -07:00
.github Bug fixes and minor features (#2) 2026-05-12 15:24:20 -07:00
benchmark Tree benchmarks (#1) 2026-05-10 23:50:16 -07:00
data initial commit 2026-05-10 13:36:52 -07:00
extern initial commit 2026-05-10 13:36:52 -07:00
include/box3d Bug fixes and minor features (#2) 2026-05-12 15:24:20 -07:00
samples Bug fixes and minor features (#2) 2026-05-12 15:24:20 -07:00
shaders initial commit 2026-05-10 13:36:52 -07:00
shared Bug fixes and minor features (#2) 2026-05-12 15:24:20 -07:00
src Bug fixes and minor features (#2) 2026-05-12 15:24:20 -07:00
test Bug fixes and minor features (#2) 2026-05-12 15:24:20 -07:00
.clang-format initial commit 2026-05-10 13:36:52 -07:00
.gitattributes initial commit 2026-05-10 13:36:52 -07:00
.gitignore initial commit 2026-05-10 13:36:52 -07:00
build.sh initial commit 2026-05-10 13:36:52 -07:00
build_vs2026.bat initial commit 2026-05-10 13:36:52 -07:00
CMakeLists.txt initial commit 2026-05-10 13:36:52 -07:00
LICENSE Initial commit 2026-05-10 13:26:19 -07:00
README.md initial commit 2026-05-10 13:36:52 -07:00

Box3D Logo

Build Status

Build Status

Box3D

Box3D is a 3D physics engine for games.

Box3D Version 3.0 Release Demo

Features

Collision

  • Continuous collision detection
  • Contact events
  • Convex polygons, capsules, circles, rounded polygons, segments, and chains
  • Multiple shapes per body
  • Collision filtering
  • Ray casts, shape casts, and overlap queries
  • Sensor system

Physics

  • Robust Soft Step rigid body solver
  • Continuous physics for fast translations and rotations
  • Island based sleep
  • Revolute, prismatic, distance, mouse joint, weld, and wheel joints
  • Joint limits, motors, springs, and friction
  • Joint and contact forces
  • Body movement events and sleep notification

System

  • Data-oriented design
  • Written in portable C17
  • Extensive multithreading and SIMD
  • Optimized for large piles of bodies

Samples

  • OpenGL with GLFW
  • Graphical user interface with imgui
  • Many samples to demonstrate features and performance

Building All Platforms

  • Install CMake
  • Install git
  • Ensure these run from the command line

Building for Visual Studio

  • Install Visual Studio
  • Run build_vs2026.bat
  • Open and build build/box3d.slnx

Building for Linux

  • Run build.sh from a bash shell
  • Results are in the build sub-folder

Building for Xcode

  • mkdir build
  • cd build
  • cmake -G Xcode ..
  • Open box3d.xcodeproj
  • Select the samples scheme
  • Build and run the samples

Building and installing

  • mkdir build
  • cd build
  • cmake ..
  • cmake --build . --config Release
  • cmake --install . (might need sudo)

Compatibility

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. This can be disabled by defining BOX3D_DISABLE_SIMD.

Documentation

Community

Contributing

Please do not submit pull requests. Instead, please file an issue for bugs or feature requests. For support, please visit the Discord server.

Giving Feedback

Please file an issue or start a chat on discord. You can also use GitHub Discussions.

License

Box3D is developed by Erin Catto and uses the MIT license.

Sponsorship

Support development of Box3D through Github Sponsors.

Please consider starring this repository and subscribing to my YouTube channel.