Box3D: Erin Catto extends Box2D into an open source 3D engine

Erin Catto, whose Box2D powers the physics in Angry Birds and countless indie games, has released Box3D, a 3D rigid-body engine that began as a fork of Valve's in-house Rubikon.

In brief

Box3D keeps almost the same architecture as Box2D, the C17 code, C API, sub-stepping solver and continuous collision, then adds triangle-mesh, height-field and baked compound collision for 3D worlds.

Its unusual origin: it began as a fork of Dirk Gregorius's Rubikon-Lite, the hobby cousin of the engine Valve built for Half-Life: Alyx, and still carries that code in convex-hull generation.

A game-networking veteran's whole review was 'Use it!!!'; another builder asked where the determinism guarantees actually are.

A 3D engine built on Box2D's bones

Box3D is an open source 3D rigid-body physics engine, and its author is blunt about the lineage: the core architecture is almost identical to Box2D. It shares the C17 codebase, the C API, the sub-stepping solver, continuous collision detection and multithreading, then adds the pieces 3D games actually need: triangle-mesh collision, height-field collision and baked compound collision.

Under the hood are graph coloring for large islands, a wide-SIMD contact solver, large-world support using doubles for position, and recording and replay.

The origin story is unusual. Box3D began as a fork of Dirk Gregorius's Rubikon-Lite, the hobby cousin of Rubikon, the physics engine Valve built for Half-Life: Alyx; the released code still carries Rubikon-Lite in its convex-hull generation and some collision algorithms. Gregorius, meanwhile, is folding similar optimizations into a new Valve engine called Ragnarok. Box3D is free to use now, with pull requests planned later (probably behind a CLA) and development funded through GitHub Sponsors and Patreon.

How does it stack up against Jolt?

The first question in the thread is comparison, since open-source 3D physics is suddenly crowded with Jolt, Rapier, PhysX and now this. The creator of the Nim programming language is mid-project and hedging:

"Funny to see this just a few days after I've started building a Tron-like 3D game for the browser using Jolt … I'll certainly be taking a look at this."

The endorsement from the founder of Network Next ran to three words:

"Yeah this library is great. Use it!!!"

For web games the standout is size. A game developer whose engine compiles to WASM measured it:

"A release build of the library is 916K (on macos at least)."

One gap stood out to the creator of jank, a Clojure dialect on LLVM, who fights nondeterminism in networked games:

"There wasn't anything about determinism in the announcement, but I'd really love to see some more about that, too."

For a networked billiards game where every client must agree on each collision, that unanswered question is the whole ballgame.

Get breakdowns like this every day

The top Hacker News stories, unpacked — by email, Telegram, or RSS.

Next story · 17 of 24 Read more
🚀Tech

A graphics programmer's syllabus: path tracing first, PBR next, minimal math

Alan Wolfe, who blogs as demofox, argues you can become a graphics programmer with only linear algebra, basic trig and a little calculus, and that the fastest on-ramp is writing a path tracer before you ever touch a real-time API.

★ 254 · 💬 137 · blog.demofox.org · 3 min