# erincatto/box3d

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/erincatto-box3d).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

6,751 stars · 383 forks · C · MIT

## Links

- GitHub: https://github.com/erincatto/box3d
- awesome-repositories: https://awesome-repositories.com/repository/erincatto-box3d.md

## Description

Box3D is a dependency-free C library for 3D rigid body physics, intended for linking into game projects. It simulates rigid bodies, stacking, joints, and ragdolls inside a physics world that is stepped with a fixed time step, so objects fall, collide, and come to rest. Bodies can be static or dynamic, and the library reports their position and rotation and notifies the application when they move or fall asleep.

What sets it apart is a focus on determinism and scale. Simulations are designed to produce identical results across platforms, and runs can be recorded and replayed to reproduce and debug physics behavior. For large body counts, solver work is spread across worker threads through task callbacks and uses AVX2, SSE2, and NEON SIMD instructions in a data-oriented design. When no worker threads are supplied, the simulation runs single-threaded. Benchmark scenes and determinism-verification scenes are included.

The collision system covers spheres, capsules, convex hulls, triangle meshes, and height fields, and several shapes can be attached to a single body. It includes continuous collision handling for fast-moving bodies, sensors that report overlaps without a collision response, contact begin and end events, and collision filtering. Ray casts, shape casts, and overlap tests can query the world. A character mover slides player and creature bodies along level geometry without passing through solid objects. A set of sample scenes demonstrates stacking, joints, ragdolls, character movement, and other behaviors.

The library builds with CMake and can be pulled in through FetchContent, a vendored subdirectory, or an installed package using a single target. Presets cover Windows, Linux, and macOS, with Debug and Release configurations plus MinGW and clang-cl alternatives, and a bash script is provided to build from source.

## Tags

### Game Development

- [Rigid Body Dynamics](https://awesome-repositories.com/f/game-development/rigid-body-dynamics.md) — Simulates rigid bodies by solving contact and joint constraints so objects fall, collide, stack and come to rest. ([source](https://github.com/erincatto/box3d/tree/main/src))
- [Rigid Body Physics Engines](https://awesome-repositories.com/f/game-development/rigid-body-physics-engines.md) — Simulates 3D rigid bodies, collisions, joints, and stacking in a dependency-free C library for game projects.
- [Deterministic Physics Simulation](https://awesome-repositories.com/f/game-development/deterministic-physics-simulation.md) — Produces identical simulation results across platforms and supports recording and replaying runs to reproduce and debug physics behavior.
- [Collision Detection](https://awesome-repositories.com/f/game-development/physics-engines/collision-detection.md) — Detects collisions between spheres, capsules, hulls, meshes, and height fields using broad-phase culling followed by precise contact generation. ([source](https://github.com/erincatto/box3d/tree/main/src))
- [Rigid Body Solvers](https://awesome-repositories.com/f/game-development/physics-engines/mechanical-constraints/mechanical-joint-constraints/rigid-body-solvers.md) — Steps rigid body motion with a soft-step solver, handles fast movement continuously, and puts inactive body groups to sleep. ([source](https://github.com/erincatto/box3d#readme))
- [Physics Simulation Engines](https://awesome-repositories.com/f/game-development/physics-simulation-engines.md) — Offers a dependency-free C physics library that games link in for collision handling, character movement, and ragdoll simulation.
- [Physics World Management](https://awesome-repositories.com/f/game-development/physics-world-management.md) — Creates a 3D physics world and steps its rigid-body simulation through a public C header interface. ([source](https://github.com/erincatto/box3d/tree/main/include/box3d))
- [Character Movement Controllers](https://awesome-repositories.com/f/game-development/character-movement-controllers.md) — Includes a character mover that slides player and creature bodies along level geometry while resolving collisions. ([source](https://github.com/erincatto/box3d/tree/main/src))
- [Character Movers](https://awesome-repositories.com/f/game-development/character-movers.md) — A character mover that slides player and creature bodies along level geometry while resolving collisions so they cannot pass through solid objects.
- [Continuous Collision Detection](https://awesome-repositories.com/f/game-development/continuous-collision-detection.md) — Sweeps fast-moving bodies along their motion path so they cannot tunnel through thin geometry. ([source](https://github.com/erincatto/box3d/blob/main/README.md))
- [Cross-Platform Determinism](https://awesome-repositories.com/f/game-development/cross-platform-determinism.md) — Includes determinism-verification scenes that replay recorded input to confirm simulation results stay identical across runs and platforms. ([source](https://github.com/erincatto/box3d/tree/main/samples))
- [Kinematic Character Controllers](https://awesome-repositories.com/f/game-development/kinematic-character-controllers.md) — Provides a character mover that slides player and creature bodies along level geometry without passing through solid objects.
- [Large-Scale Multithreaded Simulation](https://awesome-repositories.com/f/game-development/large-scale-multithreaded-simulation.md) — Spreads solver work across worker threads via task callbacks and SIMD instructions so very large piles of bodies keep running smoothly.
- [3D Collision Detection Frameworks](https://awesome-repositories.com/f/game-development/physics-engines/collision-detection/3d-collision-detection-frameworks.md) — Ships a 3D collision system covering spheres, capsules, convex hulls, triangle meshes, and height fields, with continuous sweeps, sensors, and queries.
- [Composite Collision Shape Managers](https://awesome-repositories.com/f/game-development/physics-engines/collision-detection/composite-collision-shape-managers.md) — Composes bodies from spheres, capsules, convex hulls, meshes, and height fields, with several shapes attached to one body. ([source](https://github.com/erincatto/box3d/blob/main/README.md))
- [Overlap Detection](https://awesome-repositories.com/f/game-development/physics-engines/collision-detection/fixture-shape-definitions/overlap-detection.md) — Provides sensors that report shapes entering or leaving a volume without applying any collision response. ([source](https://github.com/erincatto/box3d#readme))
- [Mechanical Joint Constraints](https://awesome-repositories.com/f/game-development/physics-engines/mechanical-constraints/mechanical-joint-constraints.md) — Provides distance, revolute, prismatic, spherical, weld, wheel and motor joints that link bodies into articulated mechanisms. ([source](https://github.com/erincatto/box3d#readme))
- [Physics Solvers](https://awesome-repositories.com/f/game-development/physics-solvers.md) — Solves constraints with a data-oriented soft-step solver spread across worker threads and AVX2, SSE2, and NEON instructions.
- [Physics World Queries](https://awesome-repositories.com/f/game-development/physics-world-management/physics-world-queries.md) — Runs ray casts, shape casts and overlap tests against the world to find bodies along a path or inside a region. ([source](https://github.com/erincatto/box3d/blob/main/README.md))
- [Multi-Body Dynamics Simulators](https://awesome-repositories.com/f/game-development/rigid-body-physics-engines/multi-body-dynamics-simulators.md) — Keeps large piles of bodies fast using data-oriented design, multithreading and SIMD in portable C code. ([source](https://github.com/erincatto/box3d#readme))

### Part of an Awesome List

- [Game Physics Integration](https://awesome-repositories.com/f/awesome-lists/ai/physics-simulation/game-physics-integration.md) — Simulates rigid bodies, stacking, joints, and ragdolls in a 3D world so objects fall, collide, and come to rest.
- [Contact Event Systems](https://awesome-repositories.com/f/awesome-lists/ai/physics-simulation/contact-event-systems.md) — Reports when bodies begin or end touching and exposes contact forces so game logic can react to impacts. ([source](https://github.com/erincatto/box3d#readme))
- [Collision Filtering](https://awesome-repositories.com/f/awesome-lists/devtools/physics-and-collision/collision-filtering.md) — Supports collision filtering rules that decide which shapes may interact so unwanted pairs are skipped. ([source](https://github.com/erincatto/box3d#readme))

### Development Tools & Productivity

- [Deterministic Record and Replay Frameworks](https://awesome-repositories.com/f/development-tools-productivity/deterministic-record-and-replay-frameworks.md) — Records simulation operations and replays them later to reproduce and debug physics behavior deterministically. ([source](https://github.com/erincatto/box3d/tree/main/src))

### Scientific & Mathematical Computing

- [Parallel Solvers](https://awesome-repositories.com/f/scientific-mathematical-computing/multi-physics-simulation-engines/parallel-solvers.md) — Splits solver work across threads via a task scheduler and uses AVX2, SSE2 and NEON SIMD to process contacts in bulk. ([source](https://github.com/erincatto/box3d/tree/main/src))

### Software Engineering & Architecture

- [Simulation Step Execution](https://awesome-repositories.com/f/software-engineering-architecture/simulation-step-execution.md) — Advances the world by a fixed time step using a sub-stepping constraint solver that trades sub-steps for accuracy. ([source](https://github.com/erincatto/box3d/blob/main/docs/hello.md))
- [Physics Simulation Threading](https://awesome-repositories.com/f/software-engineering-architecture/worker-thread-patterns/physics-simulation-threading.md) — Spreads physics work across worker threads through task callbacks and a worker count, running single-threaded when none are provided. ([source](https://github.com/erincatto/box3d/blob/main/docs/hello.md))
