Awesome
box2d-wasm
<p> <a href="https://badge.fury.io/js/box2d-wasm"><img src="https://badge.fury.io/js/box2d-wasm.svg" alt="npm version" height="18"></a> <a href="LICENSE.zlib.txt"> <img src="https://img.shields.io/badge/License-Zlib-lightgrey.svg"/> </a> <a href="https://twitter.com/intent/follow?screen_name=Birchlabs"> <img src="https://img.shields.io/twitter/follow/Birchlabs.svg?style=social&logo=twitter"/> </a> </p>Box2D compiled to WebAssembly.
Showcase
- Shapes and rope
- Lunar Survey
- Demonstrates custom gravity
- Fluid simulation
- Uses liquidfun release
- High-performance main loop
- WebGL rendering
Usage
Install the box2d-wasm
npm package
npm i box2d-wasm
Then check out the documentation.
Alternative distributions
For additional functionality:
- fluid simulation
- particle simulation
- soft-body collisions
You can install from the liquidfun branch like so:
npm i "box2d-wasm@npm:liquidfun-wasm@6.0.4-lf.1"
License
Zlib-licensed.
Links against MIT-licensed code from Erin Catto's Box2D.
Compiles Zlib-licensed code from Alon Zakai's box2d.js
.
Project
Compared to the existing box2d.js
package: box2d-wasm
aims to support Box2D v2.4.0+ and TypeScript.
Developing in this monorepo
See README.dev.md
.