I've ported over my FlashAS3 buoyancy code, which I ported from Erin's C++ code. And I will now have to report it back to Flash again. I've got to stop doing things this way...
Anyway, the attached file really has two seperate parts: firstly, the buoyancy stuff people were looking forward too, and also a b2Controller framework of dubious utility.
For those who haven't seen the Flash version, controllers were my take on how to standardize hooks to Box2D for calling code repeatedly each step. They are rather simple: you create a controller, add it to the world, and add bodies to it, and Box2D will take care of the rest. At the moment, responsibility for creating and destroying controllers is on the user; it does not use the factory pattern.
It's possible to rip out the buoyancy code if you want, just use the updated Shapes folder, and rip the relevant code out of b2BuoyancyController.cpp. But I would rather get some feedback if people think controllers are a useful tool. I hope something like this will spur contributions to Box2D, by making it a bit more "pluggable", while not being abused for non-physics features.
Anyway, the attached file really has two seperate parts: firstly, the buoyancy stuff people were looking forward too, and also a b2Controller framework of dubious utility.
For those who haven't seen the Flash version, controllers were my take on how to standardize hooks to Box2D for calling code repeatedly each step. They are rather simple: you create a controller, add it to the world, and add bodies to it, and Box2D will take care of the rest. At the moment, responsibility for creating and destroying controllers is on the user; it does not use the factory pattern.
It's possible to rip out the buoyancy code if you want, just use the updated Shapes folder, and rip the relevant code out of b2BuoyancyController.cpp. But I would rather get some feedback if people think controllers are a useful tool. I hope something like this will spur contributions to Box2D, by making it a bit more "pluggable", while not being abused for non-physics features.