liabru / matter-js

a 2D rigid body physics engine for the web ▲● ■
MIT License
16.86k stars 1.97k forks source link

Implement sensors #66

Closed aycyang closed 8 years ago

aycyang commented 9 years ago

Make it easier to create a body that ignores collision and tells whether it is intersecting another body.

liabru commented 9 years ago

I'll consider it, it's also worth checking out this related issue #65 as my thoughts are similar on this.

jstoeffler commented 8 years ago

+1

iamjoshua commented 8 years ago

+1 I've implemented something like this in my project using collision filters to avoid the actual collision but then using Query to check for other bodies on sleep to avoid the performance hit of constantly polling. This works for my specific case where bodies move incrementally and have "fields of influence" that handle non-physics/matterjs related interactions.

I'd much prefer this process to happen in real time so I'd definitely love a sensor feature!

liabru commented 8 years ago

This is now available as of 0.9.2, by setting the body.isSensor to true. Thanks guys.

Deftwun commented 8 years ago

Just a heads up that this isn't yet in the API docs

bamtheboozle commented 5 years ago

Any idea how someone can access sensor documentation since it's not in the docs?