whatisgithub

What is unity-physicsbox3d?

tnayuki/unity-physicsbox3d — explained in plain English

Analysis updated 2026-05-18

11C#Audience · developerComplexity · 3/5LicenseSetup · hard

In one sentence

A Unity plugin that connects the Box3D physics engine to Unity and benchmarks it against Unity's built-in PhysX.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

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

Compare Box3D and PhysX physics performance side by side inside Unity with a live benchmark scene.

USE CASE 2

Use Box3D as a faster alternative physics engine for Unity projects with many falling or colliding objects.

USE CASE 3

Study how batched transform syncing and Burst compilation speed up physics updates in Unity.

USE CASE 4

Visually compare how the same scene behaves under two different physics engines.

What is it built with?

C#UnityBox3DBurst Compiler

How does it compare?

tnayuki/unity-physicsbox3dincipiens/windowscontrolcenterstephenhoos/hdhomerun-jellyfin-guide
Stars111111
LanguageC#C#C#
Setup difficultyhardmoderatemoderate
Complexity3/53/53/5
Audiencedeveloperops devopsops devops

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

How do you get it running?

Difficulty · hard Time to first run · 1h+

macOS Editor only, requires cloning with submodules and building a native dylib with clang.

So what is it?

Unity-PhysicsBox3D connects the Unity game engine to Box3D, a newer open-source physics engine created by Erin Catto, and directly compares its performance against Unity's built-in PhysX physics system. Physics engines handle how objects fall, collide, and settle in a game, and this project lets a developer see, side by side, how the two engines perform under the same conditions. The binding is designed for speed. Instead of updating each object's position one at a time, it gathers all the moved objects from the physics engine in a single batch and writes their new positions back to Unity in parallel using Unity's Burst compiler, which speeds up math-heavy code. It also plugs Box3D's internal multithreading into Unity's own job system, so the physics work runs alongside Unity's other background tasks instead of spawning its own separate threads. The README includes benchmark results from tests run on an Apple Silicon Mac using a falling tower of objects. With sleep enabled, meaning objects that settle down stop being actively calculated, Box3D was measured as one and a half to over two and a half times faster than PhysX, largely because Box3D recognizes settled objects and puts them to sleep more quickly. With sleep disabled, forcing both engines to keep calculating everything, the two engines perform similarly at lower object counts, with Box3D pulling ahead as more objects are added. Setup only works on macOS in the Unity Editor, since the physics engine is compiled into a native Mac plugin. Getting started means cloning the repository with its submodules, running a build script that uses clang, and opening the project in Unity 6.3 or newer. Two example scenes are included: one that benchmarks both engines side by side with an on-screen display, and one purely for visually comparing how objects behave under each engine. This project itself is released into the public domain under the Unlicense, though the Box3D engine it depends on is separately MIT-licensed.

Copy-paste prompts

Prompt 1
Help me clone Unity-PhysicsBox3D with its submodules and build the native macOS plugin.
Prompt 2
Explain how the batched transform write-back works between Box3D and Unity in this project.
Prompt 3
Show me how to open and run the Benchmark scene to compare Box3D against PhysX.
Prompt 4
What does enabling or disabling sleep mode change in this physics benchmark?

Frequently asked questions

What is unity-physicsbox3d?

A Unity plugin that connects the Box3D physics engine to Unity and benchmarks it against Unity's built-in PhysX.

What language is unity-physicsbox3d written in?

Mainly C#. The stack also includes C#, Unity, Box3D.

How hard is unity-physicsbox3d to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is unity-physicsbox3d for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.