May 2, 2013, 3:20pm
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.
happy if anybody could explain this **))
May 8, 2013, 10:49pm
Did you check out the ‘box2D playground’ in the contributions?
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. ;)
May 9, 2013, 1:32pm
found this on my HD. maybe it helps.
Box2dplusMouse.v4p (34.9 kB)
May 10, 2013, 11:45am
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
May 10, 2013, 12:17pm
probably this task is better to be done without box2d, now i’ll try to get it with hittest plugin
May 10, 2013, 3:16pm
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.