{"id":21326757,"url":"https://github.com/dxu/matter-collision-events","last_synced_at":"2025-07-12T07:30:53.972Z","repository":{"id":57292598,"uuid":"81292557","full_name":"dxu/matter-collision-events","owner":"dxu","description":"A Matter.js plugin for adding per-body collision events and event handlers.","archived":false,"fork":false,"pushed_at":"2020-04-26T10:35:06.000Z","size":69,"stargazers_count":31,"open_issues_count":9,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-14T22:36:51.157Z","etag":null,"topics":["javascript","matter","physics-engine"],"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/dxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-08T05:46:59.000Z","updated_at":"2024-10-06T17:19:12.000Z","dependencies_parsed_at":"2022-08-27T12:20:58.491Z","dependency_job_id":null,"html_url":"https://github.com/dxu/matter-collision-events","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxu%2Fmatter-collision-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxu%2Fmatter-collision-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxu%2Fmatter-collision-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxu%2Fmatter-collision-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxu","download_url":"https://codeload.github.com/dxu/matter-collision-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225802625,"owners_count":17526452,"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":["javascript","matter","physics-engine"],"created_at":"2024-11-21T21:11:12.582Z","updated_at":"2024-11-21T21:11:13.261Z","avatar_url":"https://github.com/dxu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# matter-collision-events\n\nmatter-collision-events is a [Matter.js](https://github.com/liabru/matter-js) plugin that adds per-body collision events.\n\n## Installing\n\n`npm install matter-collision-events`\n\n## Usage\n\nRefer to [the official guide on using plugins](https://github.com/liabru/matter-js/wiki/Using-plugins) for step-by-step instructions. `matter-collision-events` can be included in the browser or imported via modules.\n\nYou can call `Matter.use('matter-collision-events')` to install the plugin itself for usage.\n\nThis plugin triggers three new events on Matter.Body:\n\n  1. `onCollide`\n  2. `onCollideEnd`\n  3. `onCollideActive`\n\nThese events correspond to the Matter.js events `collisionStart`, `collisionActive`, and `collisionEnd`, respectively. You can listen to these events via [`Matter.Events`](http://brm.io/matter-js/docs/classes/Events.html#method_on).\n\nThis plugin also extends Matter.Body with three convenience functions:\n\n  1. `Matter.Body.onCollide(callback)`\n  2. `Matter.Body.onCollideEnd(callback)`\n  3. `Matter.Body.onCollideActive(callback)`\n\nYou can register event callbacks by providing a function of type `( pair: `[`Matter.Pair`](http://brm.io/matter-js/docs/classes/Pair.html)`) =\u003e void`:\n\nExample usage can be found under the `docs` folder, which contains [a basic example of its usage](/docs/examples/basic.js).\n\n## Demo\n\n[View the demo here.](https://dxu.github.io/matter-collision-events)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxu%2Fmatter-collision-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxu%2Fmatter-collision-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxu%2Fmatter-collision-events/lists"}