Controllers

I'm not a big fan of the Factory / Def pattern in Box2d - it makes extending the core classes impossible without patching the source, so thank you for avoiding that. It would be nice to have some mechanism in place to automatically have controllers' step functions called each step... although in my framework this is trivial so I don't need it personally. The order could be defined by assigning each controller a priority (like event listeners).

I think a nice feature to have in a base controller class would be the ability to hook it up to a sensor (or more than one sensors). I can see this being the primary way controllers are used, and would be nice to have in the base class so every controller doesn't have to implement it's own bind-to-sensor functionality. This would also allow the use of mask & category bits (on the sensor) to filter out what the controller controls.

Would also be cool if the direction of the force / acceleration applied by the controller could be rotated by the rotation of the sensor involved in the contact, but that would probably be up to the implementation of each controller.

Contrary to this, it would also be nice to be able to tell a controller to effect all bodies in the world (since I'm going to be using them to implement gravity).

Just some thoughts.
I agree with everything you just said, but I'm still gonna leave a lot to individual frameworks. Box2D at the moment leaves tasks such as determining what shapes are overlapping a sensor to the user, so I'm taking that as a guideline that I should leave any similar features to the user as well. The ideas you've suggested for multicontrollers are good, but the variety of them alone suggests it would horribly complicate the API to include everything like that.

I was considering the following complication though, which does some of what you want at a smallish complexity cost: You could separate entirely the "action" of a controller from the "membership" of a controller. So a controller just contains it's parameters, plus a separate object that provides to it an iterable (in Python terminology, AS3 has no such concept) of bodies. You'd have a couple of possible iterators; one which always returns everything, one for a fixed list, one that is based off a sensor (possibly) etc. The iterators could also return a "degree of membership" for each contained body.
amazing work!!!
Only one thing... Wath do u think about the water pressure??? I mean the cros still stopped at differents depths.
lol, I'm only joking... you are a great developer!!

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