Sooo..... I've got a shape i use as a sensor.
i listen for ADD and REMOVE contact events. i'd like a certain effect to happen to bodies whose shapes are intersecting with the sensor.
the idea is that when an ADD event occurs involving the sensor, i add the body of the intersecting shape to an Array, "BODIES", if it's not already in there. on a REMOVE event of a shape, i remove the associated body from BODIES.
the problem is that REMOVE events are called even though the shapes are completely within this sensor. i figured once a shape enters, a REMOVE event wouldn't be called again until it is no longer intersecting.
i plan on working around it by just comparing AABBs, but I'd like to understand why REMOVE is being called here.... and also if i'm doing something wrong.
i listen for ADD and REMOVE contact events. i'd like a certain effect to happen to bodies whose shapes are intersecting with the sensor.
the idea is that when an ADD event occurs involving the sensor, i add the body of the intersecting shape to an Array, "BODIES", if it's not already in there. on a REMOVE event of a shape, i remove the associated body from BODIES.
the problem is that REMOVE events are called even though the shapes are completely within this sensor. i figured once a shape enters, a REMOVE event wouldn't be called again until it is no longer intersecting.
i plan on working around it by just comparing AABBs, but I'd like to understand why REMOVE is being called here.... and also if i'm doing something wrong.