Add realistic rigid-body physics to a browser-based 3D game so objects fall, collide, and bounce under gravity.
Run cloth, rope, or soft-body simulations in a web browser without a server-side physics engine.
Prototype a vehicle simulation with suspension and wheel friction that runs entirely in the browser.
Use ammo.js with Three.js or Babylon.js to synchronize visual objects with physics simulation positions.
| kripken/ammo.js | infiniflow/infinity | hkust-aerial-robotics/vins-fusion | |
|---|---|---|---|
| Stars | 4,511 | 4,511 | 4,512 |
| Language | C++ | C++ | C++ |
| Setup difficulty | easy | easy | hard |
| Complexity | 3/5 | 3/5 | 5/5 |
| Audience | developer | developer | researcher |
Figures from each repo's GitHub metadata at analysis time.
A prebuilt ammo.js file is included in the repo under builds/ so most users don't need to compile anything, building from source requires Emscripten and cmake.
Ammo.js is a version of the Bullet physics engine that runs inside a web browser. Bullet is a well-established physics simulation library written in C++, used in games and 3D applications to simulate how objects fall, collide, bounce, and interact with forces. Normally Bullet runs as native compiled code on a desktop or console. Ammo.js makes the same physics engine available to JavaScript developers by translating the C++ source code into JavaScript automatically using a tool called Emscripten, rather than rewriting it by hand. The name is an acronym: Avoided Making My Own js physics engine by compiling bullet from C++. Because the translation is automated rather than hand-written, the API closely mirrors the original Bullet API. JavaScript developers access physics objects through an Ammo namespace: for example, creating a vector is done with new Ammo.btVector3(x, y, z). Struct member variables that would be directly readable in C++ are accessed through getter and setter functions in the JavaScript version. The library ships with both a standard JavaScript build and a WebAssembly build, which is a more compact binary format that browsers can load and execute faster. The project includes several live browser demos covering common physics scenarios: a stack of cubes colliding under gravity, a rope, cloth, a soft volume, a height-mapped terrain, and a vehicle simulation. These demonstrate what Bullet can do and give developers concrete examples to reference. A prebuilt version of ammo.js is included in the repository under the builds directory, so most developers can start using it without compiling anything themselves. For those who want to build from source, the process requires Emscripten and cmake. A Docker-based build path is also available. Build size can be reduced by removing unused interfaces from the interface definition file. Ammo.js is licensed under the zlib license, the same license as Bullet. It is used most often by developers building 3D games or simulations that run in the browser and need realistic physics without writing a physics engine themselves.
The Bullet physics engine ported to JavaScript and WebAssembly so web developers can add realistic physics, falling, colliding, bouncing objects, to browser-based 3D games and simulations without writing a physics engine.
Mainly C++. The stack also includes C++, JavaScript, WebAssembly.
Use freely for any purpose including commercial, the zlib license only asks that you don't misrepresent the origin of the software.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.