ammo.js is a physics engine library that brings the Bullet physics simulation engine to JavaScript through automatic compilation using Emscripten.
The tool solves the problem of needing a full-featured physics engine in web applications without having to rewrite physics simulation logic from scratch. It works by directly translating the Bullet physics engine source code from C++ to JavaScript automatically, preserving the original functionality without manual rewriting. This approach ensures that the JavaScript version maintains feature parity with the native Bullet engine, supporting rigid body dynamics, soft body simulation, vehicle physics, and collision detection.
Developers should choose ammo.js if they need physics simulation in a JavaScript-based web application and want access to a mature, well-tested physics engine. The tool suits projects requiring complex physics interactions such as interactive 3D scenes, games, or physics-based simulations in the browser. The project provides prebuilt versions ready to use immediately, though developers can also build custom versions themselves. If you are writing C++ code intended for the web, you may not need ammo.js at all—you can instead use Bullet directly through emscripten-ports with the appropriate compiler flag. The JavaScript API is autogenerated from Bullet's source, so all physics objects are accessed through the Ammo namespace, and member variables are exposed through getter and setter functions rather than direct property access.
The project maintains a stable prebuilt distribution in its builds directory and provides multiple working examples demonstrating rigid body physics, soft body rope and cloth simulation, terrain heightmaps, and vehicle dynamics. Development discussion occurs in the project's designated IRC channel.