How to detect overlapping sensors in WCK

I have searched many forums but I can't seem to find any sample code for this.

How can I detect if Sensor A is currently overlapping Sensor B or not in Box2d Alchemy Port / WCK? 😢
I can't recall if sensors don't collide at all. I think they don't. You could get creative with category & mask bits to make one of the bodies behave like a sensor, even if it isn't one.
Thanks for the reply mayobutterI think they are colliding because the BEGIN_CONTACT fires when they touch, but I don't want to use that listener because the END_CONTACT also fires even if Sensor B is still touching Sensor A. Is there someting like
Code:
SensorA.hitTestObject(SensorB)
that i could check anytime i want like in ENTER_FRAME or TIMER? Well it kinda worked but it detects the overlapping of both sensors' rectangle bounding box, not their polygon shape. I'm looking forward to your reply mayo, thanks again!
help please..i like wck..anyone?
I don't want my code to detect collisions, instead, I want to detect if Sensor A is OVER Sensor B in a 'pixel perfect' manner. 🙂 Is there no solution for this? 😀
It sounds like you've got complicated polygon sensors set up with the possibility for multiple contact points?

use something like a contact counter. When you get a BEGIN_CONTACT increment it. When you get an END_CONTACT decrement it. So then you know if it's over zero you've got a contact.
mayobutter wrote:
It sounds like you've got complicated polygon sensors set up with the possibility for multiple contact points?

use something like a contact counter. When you get a BEGIN_CONTACT increment it. When you get an END_CONTACT decrement it. So then you know if it's over zero you've got a contact.


Thanks again for reply. Yes I have tried that before, but I had a problem using that method. You see the problem is when sensor A (smaller) hits sensor B (larger) I get BEGIN_CONTACT BUT when sensor A goes inside sensor B, i get END_CONTACT already, which i supposed it should not because they're still in contact with each other. I have a poly (ellipse-shaped, not so complicated) sensor with 20+ vertices with 50% fill color transparency.

Original thread: https://box2d.org/forum/viewtopic.php?t=7161