A JavaScript 2D rigid body physics engine for the web, enabling realistic physics simulations in browsers and Node.js.
Matter.js is a 2D rigid body physics engine for the web, written in JavaScript. It simulates realistic physics interactions like collisions, gravity, friction, and constraints, enabling developers to create interactive games, simulations, and visualizations directly in browsers or Node.js. The engine handles complex body types, composite structures, and provides tools for rendering and debugging.
Web developers and game creators building 2D interactive experiences, educational simulations, or physics-based visualizations that require realistic object interactions in a browser environment.
Developers choose Matter.js for its comprehensive feature set, cross-browser compatibility, and ease of integration with web projects. As an original JavaScript implementation (not a port), it offers stable performance, a simple API, and extensibility through plugins, making it a go-to solution for 2D physics on the web.
a 2D rigid body physics engine for the web ▲● ■
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports rigid bodies, compounds, constraints, and multi-phase collision detection, enabling realistic simulations like those in demos for bridges and catapults.
Works across all major browsers including IE8+, Node.js, and is mobile-friendly with touch support, as highlighted in the cross-platform features.
Can be installed via npm or included as a script, with a built-in Canvas renderer and minimal setup, making it accessible for quick prototypes.
Offers a plugin system with guides for creating and using custom plugins, allowing developers to enhance functionality as needed.
The README warns that default configs in Webpack and Vue can reduce performance, requiring manual fixes like adjusting sourcemaps or watchers.
As a 2D engine, it cannot handle 3D physics, limiting its use for projects requiring depth or volumetric simulations.
The included Canvas renderer is basic and may not suffice for graphics-intensive applications needing WebGL or advanced visual effects.