Matter.js is a 2D rigid body physics engine for the web written in JavaScript (yes, another).
Features:
- Physical properties (mass, area, density etc.)
- Rigid bodies of any convex polygon
- Stable stacking and resting
- Restitution (elastic and inelastic collisions)
- Conservation of momentum
- Friction and resistance
- Constraints
- Gravity
- Composite bodies
- Sleeping and static bodies
- Original JavaScript physics implementation (not a port)
- HTML5 canvas renderer (optional)
- Mobile-compatible (touch, scaleable)
- Cross-browser (chrome, firefox, IE8+)
- World state serialisation (requires resurrect.js)
- Built in GUI for testing (requires dat.gui.js)
- Time scaling (slow-mo, speed-up)
- Broad-phase, mid-phase and narrow-phase collisions
- Events (edge)
- Sprite texture rendering (edge)