sensor dilemma

Oct 27, 2008 at 6:02 AM
Hello,
I'm running into a problem with this idea of sensors.
A sensor is just a static body whose geom has a CollisionResponseEnabled set to false.

Sensors appear in the arbiterList when they come in contact with bodies that are non-static with geoms with CollisionResponseEnabled true.
The arbiterList is the list of geoms that are currently colliding with something.

I want a sensor to be able to detect another sensor.

Seeing as it is now, I'm going to have to create a new type of static property that resets its "dynamics" such as forces every update and resets its position as well, simulating the idea of a static body.

I don't only want sensors to detect sensors, but static bodies as well with their CollisionResponseEnabled (in their geoms) set as true.

Does anyone know a more simple way of doing this?
Coordinator
Oct 27, 2008 at 4:11 PM
"Sensors appear in the arbiterList when they come in contact with bodies that are non-static with geoms with CollisionResponseEnabled true."

Indeed, but also when CollisionResponseEnabled equals false. They are just not applied impulses caused by the collision.

"The arbiterList is the list of geoms that are currently colliding with something."

Yes, but more accurately: ArbiterList is a list of arbiters. An arbiter is a pair of geoms that collide with each other. Arbiters are created in the broad phase collision detection phase.

 "I want a sensor to be able to detect another sensor."

Well, as you said before, sensors are static bodies. They do not move and can therefor not detect other sensors. If you have 2 sensors, both of them would stand still and therefore not be checked for collisions.

Why would you want static bodies (and therefore sensors) to collide?
Oct 27, 2008 at 6:46 PM
@genbox, I knew I should have stated why I want to do this. I want to have, in essence, moving sensors: bodies that move around, but do not affect objects on-screen, yet pick up collision events.
Coordinator
Oct 27, 2008 at 9:47 PM
You can do this simply by just setting the CollisionResponseEnabled to false on a geometry. It will still pick up the collision event, but impulses applied from collision are not calculated.
Oct 28, 2008 at 12:13 AM
Thank you, it appears to be working now. =)