I have two objects that is masked not to collide.
If I do an aabb on object1, object 2 is one of the bodies in contact with it. Will the count be 1 or 0?
My aim is to get then not to collide but I still wanna know if they are touching each other. Is this achievable?
This is what sensors are for, depending on which version you are using you could just use these.
Ha...you mean it is in release 2.0? Awesome.
Do you know how to use it? 😀
Mind if you give me a rough demonstration.
Well this is a little complicated because of so many changes recently. I am using the Box2D Flash 1.4.3, modified to have sensors (very small modification). I have it basically implemented now to copy how it is done in 2.0, only my property name for it is a little different. So if you are using 2.0 (or some approximation thereof, since it's not finished) I believe you set the isSensor value to true for your b2ShapeDef. The only thing is that the current revision of Box2D has callbacks for contacts, and you don't just check the contact list anymore. I have not worked with this version so I cannot say how it works exactly. It would be helpful to know if you are working with a version that uses the contact list method or the callbacks.
EDIT: I almost forgot, if you make a shape a sensor, I don't believe it will register the contact if you still have a mask or group set that prevents this. So use the sensor only and not sensor and mask, unless you want certain things to not even register contacts with the sensor at all of course.