JavaScript, Matter.js: Disable collision for one body

僤鯓⒐⒋嵵緔 提交于 2019-12-04 06:33:02

You can use collision filters to do this. You can see an example of them working in the collision filtering demo and the source code.

They work similarly to how they do in Box2d, for which there is a good article you can use to get an idea of how they work.

Christopher Stock

see

Matter.IBodyDefinition.isSensor

in order to disable physical collisions for the Body. The Body can still be used as a sensor for collisions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!