I’ve been looking around for an engine I could use in future projects, and have found a few options that I thought I should share:
- AmmoJS: GitHub - kripken/ammo.js: Direct port of the Bullet physics engine to JavaScript using Emscripten
- 1.9MB filesize
- Last updated Mar, 2022
- Used in most Three.js physics examples
- Can be used in a web-worker
- Enable3d: https://enable3d.io/
- Uses Three.js and Ammo.js
- “Headless mode” lets you compute physics in Node.js server
- Last updated Jun 2022
- Cannon-es: GitHub - pmndrs/cannon-es: 💣 A lightweight 3D physics engine written in JavaScript.
- Forked from outdated CannonJS (see below)
- 338KB filesize
- Last updated Jan 2022
- OimoPhysics: GitHub - saharan/OimoPhysics: A cross-platform 3D physics engine
- Demos are written in Haxe, so it might be hard to follow along.
- Used in Three.js + Oimo Instancing example although it requires some porting to work with Three.js
- Last updated Jan 2022
Possibly outdated libraries
- Oimo.js: GitHub - lo-th/Oimo.js: Lightweight 3d physics engine for javascript
- 352KB filesize
- Last updated Jan 21, 2019
- Runs on main thread, not a web-worker
- Ammo.lab: GitHub - lo-th/Ammo.lab: Ammo.lab advanced 3d physics worker for three.js
- Library with Ammo in a Web worker
- Last updated Nov 27, 2019
- Physijs: GitHub - chandlerprall/Physijs: Physics plugin for Three.js
- 43KB filesize
- No longer maintained (last updated in 2015)
- Reported to still work with r103 (and maybe newer) version of Three.js
- CannonJS: GitHub - schteppe/cannon.js: A lightweight 3D physics engine written in JavaScript.
- 384KB filesize
- No longer maintained (last updated May 2, 2016), unsure if it’s still compatible with latest ThreeJS
-
@swifterik has written a working demo that uses
ThreeJS r113
with the last version of Cannon in his sandbox
If anybody has any additional suggestions for a simple box-collision engine, I’d appreciate other options!