# Box3D — High-Performance 3D Physics Engine for Games > Box3D is a 3D physics engine by Erin Catto, the creator of Box2D, offering fast rigid-body simulation with modern solver algorithms for game and simulation developers. ## Install Save in your project root: # Box3D — High-Performance 3D Physics Engine for Games ## Quick Use ```c // Link against box3d library #include "box3d/box3d.h" b3WorldDef worldDef = b3DefaultWorldDef(); worldDef.gravity = (b3Vec3){0.0f, -9.81f, 0.0f}; b3WorldId world = b3CreateWorld(&worldDef); // Step the simulation b3World_Step(world, 1.0f / 60.0f, 4); ``` ## Introduction Box3D is a 3D physics engine written in C by Erin Catto, the renowned creator of Box2D. It extends the proven design principles of Box2D into three dimensions, providing fast and accurate rigid-body simulation for games, robotics, and interactive applications. ## What Box3D Does - Simulates 3D rigid-body dynamics with collision detection and response - Supports common 3D shapes (boxes, spheres, capsules, convex hulls) - Provides joints and constraints for articulated bodies and mechanisms - Handles continuous collision detection to prevent tunneling - Delivers deterministic simulation results for consistent behavior ## Architecture Overview Box3D follows a data-oriented design in pure C for maximum performance and portability. The broad phase uses a dynamic bounding volume hierarchy for spatial queries. The narrow phase computes contact manifolds using GJK and SAT algorithms. The solver uses a modern approach with warm starting and sub-stepping for stable, accurate constraint resolution. ## Self-Hosting & Configuration - Build with CMake on any platform with a C11 compiler - Link as a static or shared library into your game engine or application - Configure world gravity, solver iterations, and time step size at initialization - Tune collision filtering using category and mask bits - Sample applications included for testing and reference ## Key Features - Written in pure C for maximum portability and performance - Data-oriented design with cache-friendly memory layouts - Multithreaded island solving for parallel simulation - Continuous collision detection prevents fast-moving objects from tunneling - Created by the author of Box2D with decades of physics engine expertise ## Comparison with Similar Tools - **Bullet Physics** — Mature and feature-rich but complex C++ API; Box3D is simpler and C-based - **PhysX (NVIDIA)** — High performance but proprietary with complex licensing; Box3D is open source - **Rapier** — Rust-based physics engine; Box3D targets C for broader engine integration - **Jolt Physics** — Modern C++ engine; Box3D offers a simpler C API with similar performance goals ## FAQ **Q: Is Box3D related to Box2D?** A: Yes. Both are created by Erin Catto. Box3D extends the design philosophy of Box2D into three dimensions. **Q: Can I use it with Unity or Unreal?** A: Not directly, but the C API can be integrated as a native plugin in any engine. **Q: Is it production-ready?** A: Box3D is in early development. Check the repository for current stability status. **Q: Does it support soft bodies or cloth?** A: No. Box3D focuses on rigid-body dynamics. Use a dedicated solver for deformable bodies. ## Sources - https://github.com/erincatto/box3d - https://box2d.org --- Source: https://tokrepo.com/en/workflows/asset-20900a53 Author: AI Open Source