{"id":13407544,"url":"https://github.com/liabru/matter-js","last_synced_at":"2025-05-13T18:05:15.988Z","repository":{"id":14278392,"uuid":"16986405","full_name":"liabru/matter-js","owner":"liabru","description":"a 2D rigid body physics engine for the web ▲● ■","archived":false,"fork":false,"pushed_at":"2024-08-17T14:14:36.000Z","size":22865,"stargazers_count":17402,"open_issues_count":279,"forks_count":1984,"subscribers_count":238,"default_branch":"master","last_synced_at":"2025-05-05T23:13:18.231Z","etag":null,"topics":["canvas","javascript","physics","physics-engine","rigid-bodies","web"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liabru.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-19T14:16:17.000Z","updated_at":"2025-05-05T21:17:42.000Z","dependencies_parsed_at":"2022-07-14T03:50:33.755Z","dependency_job_id":"af7113bb-f64e-4956-a356-938828ae59fb","html_url":"https://github.com/liabru/matter-js","commit_stats":{"total_commits":897,"total_committers":27,"mean_commits":33.22222222222222,"dds":"0.27201783723522854","last_synced_commit":"7ec38a1f1c7cbfc5e37cc2a1c1b9a2978dc06ab0"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liabru%2Fmatter-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liabru","download_url":"https://codeload.github.com/liabru/matter-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590632,"owners_count":21772940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canvas","javascript","physics","physics-engine","rigid-bodies","web"],"created_at":"2024-07-30T20:00:42.663Z","updated_at":"2025-05-05T23:13:20.956Z","avatar_url":"https://github.com/liabru.png","language":"JavaScript","funding_links":[],"categories":["2D Physics Abstractions","JavaScript","Web 前端","Javascript","javascript","目录","web","UI Components","IOS","Libraries","Css \u0026\u0026 动画","Frameworks/Engines/Libraries","3D","Mechanics","Game Engines \u0026 Physics","Uncategorized"],"sub_categories":["3D and Games","JavaScript","iOS","Rigid Bodies and Physics Engines","Uncategorized"],"readme":"\u003cimg alt=\"Matter.js\" src=\"https://brm.io/matter-js/img/matter-js.svg\" width=\"300\"\u003e\n\n\u003e *Matter.js* is a JavaScript 2D rigid body physics engine for the web\n\n[brm.io/matter-js](https://brm.io/matter-js/)\n\n[Demos](#demos) ・ [Gallery](#gallery) ・ [Features](#features) ・ [Plugins](#plugins) ・ [Install](#install) ・ [Usage](#usage) ・ [Examples](#examples) ・ [Docs](#documentation) ・ [Wiki](https://github.com/liabru/matter-js/wiki) ・ [References](#references) ・ [License](#license)\n\n### Demos\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#mixed\"\u003eMixed Shapes\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#mixedSolid\"\u003eSolid Shapes\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#svg\"\u003eConcave SVG Paths\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#terrain\"\u003eConcave Terrain\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#concave\"\u003eConcave Bodies\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#compound\"\u003eCompound Bodies\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#newtonsCradle\"\u003eNewton's Cradle\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#wreckingBall\"\u003eWrecking Ball\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#slingshot\"\u003eSlingshot Game\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#rounded\"\u003eRounded Corners\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#views\"\u003eViews\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#timescale\"\u003eTime Scaling\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#manipulation\"\u003eBody Manipulation\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#compositeManipulation\"\u003eComposite Manipulation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#raycasting\"\u003eRaycasting\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#sprites\"\u003eSprites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#pyramid\"\u003ePyramid\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#car\"\u003eCar\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#catapult\"\u003eCatapult\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#gravity\"\u003eReverse Gravity\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#bridge\"\u003eBridge\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#avalanche\"\u003eAvalanche\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#softBody\"\u003eBasic Soft Bodies\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#cloth\"\u003eCloth\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#events\"\u003eEvents\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#collisionFiltering\"\u003eCollision Filtering\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#chains\"\u003eChains\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#ballPool\"\u003eBall Pool\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#stack\"\u003eStack\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#circleStack\"\u003eCircle Stack\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#compoundStack\"\u003eCompound Stack\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#restitution\"\u003eRestitution\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#friction\"\u003eFriction\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#airFriction\"\u003eAir Friction\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#staticFriction\"\u003eStatic Friction\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#sleeping\"\u003eSleeping\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#beachBalls\"\u003eBeach Balls\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#stress\"\u003eStress 1\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#stress2\"\u003eStress 2\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"https://brm.io/matter-js/demo/#sensors\"\u003eSensors\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cbr\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### Gallery\n\nSee how others are using matter.js physics\n\n- [Patrick Heng](https://patrickheng.com/) by Patrick Heng\n- [USELESS](https://useless.london/) by Nice and Serious\n- [Secret 7](https://secret-7.com/) by Goodness\n- [New Company](https://www.new.company/) by New Company\n- [Game of The Year](https://gameoftheyear.withgoogle.com/) by Google\n- [Pablo The Flamingo](https://pablotheflamingo.com/) by Nathan Gordon\n- [Les métamorphoses de Mr. Kalia](https://lab212.org/oeuvres/2:art/18/Les-metamorphoses-de-Mr-Kalia) by Lab212\n- [Phaser](https://phaser.io/) by Photon Storm\n- [Sorry I Have No Filter](https://sorryihavenofilter.com/pages/about/) by Jessica Walsh\n- [Fuse](https://fuse.blog/) by Fuse\n- [Glyphfinder](https://www.glyphfinder.com/) by überdosis\n- [Isolation](https://isolation.is/postcards/my-week) by sabato studio\n- [more...](https://github.com/liabru/matter-js/wiki/Gallery)\n\n### Features\n\n- Rigid bodies\n- Compound bodies\n- Composite bodies\n- Concave and convex hulls\n- Physical properties (mass, area, density etc.)\n- Restitution (elastic and inelastic collisions)\n- Collisions (broad-phase, mid-phase and narrow-phase)\n- Stable stacking and resting\n- Conservation of momentum\n- Friction and resistance\n- Events\n- Constraints\n- Gravity\n- Sleeping and static bodies\n- Plugins\n- Rounded corners (chamfering)\n- Views (translate, zoom)\n- Collision queries (raycasting, region tests)\n- Time scaling (slow-mo, speed-up)\n- Canvas renderer (supports vectors and textures)\n- [MatterTools](https://github.com/liabru/matter-tools) for creating, testing and debugging worlds\n- World state serialisation (requires [resurrect.js](https://github.com/skeeto/resurrect-js))\n- Cross-browser and Node.js support (Chrome, Firefox, Safari, IE8+)\n- Mobile-compatible (touch, responsive)\n- An original JavaScript physics implementation (not a port)\n\n### Install\n\nYou can install using package managers [npm](https://www.npmjs.org/package/matter-js) and [Yarn](https://yarnpkg.com/) using:\n\n    npm install matter-js\n\nAlternatively you can download a [stable release](https://github.com/liabru/matter-js/tags) or try the latest experimental [alpha build](https://github.com/liabru/matter-js/tree/master/build) (master) and include the script in your web page:\n\n    \u003cscript src=\"matter.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\n### Performance with other tools (e.g. Webpack, Vue etc.)\n\nBundlers and frameworks may reduce real-time performance when using their default configs, especially in development modes.\n\nWhen using [Webpack](https://webpack.js.org/), the default sourcemap config can have a large impact, for a solution see [issue](https://github.com/liabru/matter-js/issues/1001).\n\nWhen using [Vue.js](https://vuejs.org/), watchers can have a large impact, for a solution see [issue](https://github.com/liabru/matter-js/issues/1001#issuecomment-998911435). \n\n### Usage\n\nVisit the [Getting started](https://github.com/liabru/matter-js/wiki/Getting-started) wiki page for a minimal usage example which should work in both browsers and Node.js.  \nAlso see the [Running](https://github.com/liabru/matter-js/wiki/Running) and [Rendering](https://github.com/liabru/matter-js/wiki/Rendering) wiki pages, which show how to use your own game and rendering loops.\n\n### Tutorials\n\nSee the list of [tutorials](https://github.com/liabru/matter-js/wiki/Tutorials).\n\n### Examples\n\nSee the [examples](https://github.com/liabru/matter-js/tree/master/examples) directory which contains the source for all [demos](#demos).  \nThere are even more examples on [codepen](https://codepen.io/collection/Fuagy/).\n\n### Plugins\n\nThe engine can be extended through plugins, see these resources:\n\n- [Using plugins](https://github.com/liabru/matter-js/wiki/Using-plugins)\n- [Creating plugins](https://github.com/liabru/matter-js/wiki/Creating-plugins)\n- [List of plugins](https://github.com/liabru/matter-js/wiki/List-of-plugins)\n- [matter-plugin-boilerplate](https://github.com/liabru/matter-plugin-boilerplate)\n\n### Documentation\n\nSee the [API Documentation](https://brm.io/matter-js/docs/) and the [wiki](https://github.com/liabru/matter-js/wiki)\n\n### Building and Contributing\n\nTo build you must first install [node.js](https://nodejs.org/), then run\n\n\tnpm install\n\nThis will install the required build dependencies, then run\n\n\tnpm run dev\n\nto spawn a development server. For information on contributing see [CONTRIBUTING.md](https://github.com/liabru/matter-js/blob/master/CONTRIBUTING.md).\n\n### Changelog\n\nTo see what's new or changed in the latest version, see the [changelog](https://github.com/liabru/matter-js/blob/master/CHANGELOG.md).\n\n### References\n\nSee the wiki page on [References](https://github.com/liabru/matter-js/wiki/References).\n\n### License\n\nMatter.js is licensed under [The MIT License (MIT)](https://opensource.org/licenses/MIT)  \nCopyright (c) 2014 Liam Brummitt\n\nThis license is also supplied with the release and source code.  \nAs stated in the license, absolutely no warranty is provided.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliabru%2Fmatter-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliabru%2Fmatter-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliabru%2Fmatter-js/lists"}