explaingit

erincatto/box3d

Analysis updated 2026-07-03 · repo last pushed 2026-07-03

⭐ Rising2,728CAudience · developerComplexity · 4/5ActiveLicenseSetup · moderate

TLDR

A 3D physics engine for games that handles how objects fall, collide, slide, and break in real time. You link it into your C or C++ game engine so crates stack, balls roll, and vehicles respond to terrain without writing physics from scratch.

Mindmap

mindmap
  root((repo))
    What it does
      Collision detection
      Physics simulation
      Character movement
      Replay and recording
    Collision features
      Spheres and capsules
      Convex hulls
      Triangle meshes
      Ray casts
    Physics features
      Joints and motors
      Rigid body dynamics
      Fast object handling
    Tech stack
      C17
      SIMD instructions
      Multithreading
      No external dependencies
    Use cases
      Custom game engines
      Networked games
      Debugging gameplay
    Audience
      Game developers
      C and C++ programmers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add realistic 3D collision and rigid body physics to a custom game engine.

USE CASE 2

Build hinged doors, wheels, or motors using joint constraints.

USE CASE 3

Implement player avatar movement with the built-in character mover system.

USE CASE 4

Create deterministic networked gameplay where physics run identically across machines.

What is it built with?

CC17SIMD

How does it compare?

erincatto/box3dsandboxie/sandboxielienol/openwrt
Stars2,7283,6333,660
LanguageCCC
Last pushed2026-07-03
MaintenanceActive
Setup difficultymoderatemoderatehard
Complexity4/53/55/5
Audiencedeveloperops devopsops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a C17 compiler and integration into an existing C or C++ build system, no external dependencies but you must wire it into your game loop manually.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Box3D is a 3D physics engine for games. In plain terms, it handles the simulation of physical objects, how they fall, collide, bounce, slide, and break, so that a game world feels realistic and responsive. If you're building a 3D game and need crates to stack, balls to roll downhill, or vehicles to respond to terrain, this library does that heavy lifting for you. At a high level, the engine handles two big jobs: collision detection and physics simulation. On the collision side, it knows about common shapes like spheres, capsules, convex hulls, and triangle meshes. It can detect when objects hit each other (even when moving very fast), filter which objects should interact, and support queries like ray casts, useful for things like aiming a weapon or checking line of sight. On the physics side, it solves how bodies move after impact, supports joints and motors so you can build things like hinged doors or wheels, and includes a "character mover" system for handling how a player avatar walks around the world. It also supports recording and replay, which helps with debugging or creating deterministic gameplay. The people who'd use this are game developers working in C or C++ who need real-time 3D physics and want to integrate it directly into their engine. For example, someone building a custom game engine (rather than using Unity or Unreal) could link this in to get collision and rigid body dynamics without writing a physics system from scratch. It runs on Windows, macOS, and Linux, and ships with a sample app showing off its capabilities. What's notable is the engineering approach. It's written in portable C17 with no external dependencies, uses multithreading and SIMD instructions for performance, and is designed to handle large piles of bodies efficiently. It also offers cross-platform determinism, meaning a simulation runs identically on different machines, which matters for networked games or competitive play where consistency is critical. The project is created by Erin Catto, who also built the widely used Box2D engine, and is MIT licensed.

Copy-paste prompts

Prompt 1
I want to integrate Box3D into my custom C++ game engine. Show me how to initialize the physics world, create a few rigid bodies with sphere and box shapes, and step the simulation each frame.
Prompt 2
Using Box3D, how do I set up a hinged door joint between a static wall and a dynamic door body so it swings realistically when pushed?
Prompt 3
Help me implement a ray cast query in Box3D to check line of sight from my player to a target, and return the first object that is hit.
Prompt 4
I need cross-platform deterministic physics for my networked game. How do I configure Box3D to ensure simulations run identically on Windows, macOS, and Linux?

Frequently asked questions

What is box3d?

A 3D physics engine for games that handles how objects fall, collide, slide, and break in real time. You link it into your C or C++ game engine so crates stack, balls roll, and vehicles respond to terrain without writing physics from scratch.

What language is box3d written in?

Mainly C. The stack also includes C, C17, SIMD.

Is box3d actively maintained?

Active — commit in last 30 days (last push 2026-07-03).

What license does box3d use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is box3d to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is box3d for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub erincatto on gitmyhub

Verify against the repo before relying on details.