2D rigid body physics engine for the web in JavaScript, with collisions, constraints and a canvas renderer
open sourceMITfree
Matter.js is an MIT-licensed 2D rigid body physics engine for the web, written in JavaScript by Liam Brummitt as an original implementation rather than a port. It simulates rigid, compound and composite bodies with mass, friction, restitution, gravity and constraints, detects collisions and supports raycasting, sleeping bodies, time scaling and plugins, and ships a canvas renderer. It runs in browsers and Node.js, and its gallery lists projects built on it, among them Phaser. It isn't the Matter smart home library of the same name.
Problems it solves
- add 2D physics to a browser game
- simulate falling, stacking and colliding shapes on a web page
- make interactive physics animations on a website with JavaScript
Features
- rigid, compound and composite bodies
- concave and convex hulls
- collisions with broad, mid and narrow phases
- constraints, friction, restitution and gravity
- raycasting and region queries
- sleeping and static bodies
- time scaling
- canvas renderer
- plugins
- runs in browsers and Node.js
Alternatives
The same job
These do what Matter.js does.
- Box2D 2D physics engine for games, written in portable C
