Please help me to understand how to use isSensor feature of the box2d shapes.
from the presentation for node10 box2d workshop"i’ve learned that
Shapes which are sensors will intersect with others instead of colliding, bouncing etc, but information about their interactions can be retrieved through getContactDetails node.
You can manage which shapes interact with other like physical bodies or not with group indices.
I cannot get this to work. When switching on isSensor pin, my shapes dont fell anything regardless of group indices, and no any data appears in getContactDetails.
This probably does everything you ever wanna know about Box2d … all in one very pretty patch.
I’m guessing the IsSensor pin is not really what you’re looking for. You could try to explain a little more what you actually want to achieve in your own patch. Somebody will probably tuck a little demo patch together for you. ;)
Hi zepi, thx for your reply,
but i still cant get the behavior i need.
i just want some circles move overlapping some lines (or quads) without any physical simulation, but i need to know when specific circle intresects with any line (or quad).
i cant get it with raycast nor with aabb query, cause aabb works only for two quads and rays dont fit also.
suppose sensor flag should do exactly what i need but it doesnt work, maybe its a bug.
as to groups that are collliding or not, here all right, no problems
Ah, seems since latest version Sensor in contact is indeed broken.
Issue is now contacts are retrieved via ContactResult (to retrieve normals/impulse) instead of ContactAdd, but Sensors of course don’t produce a result…
Added GetContactReport node, which includes sensors, needs a bit more testing (for filtering), but seems to do what’s expected.