Box2D Buoyancy

BlitzMax Forums/Brucey's Modules/Box2D Buoyancy

Armitage 1982(Posted 2008) [#1]
Hi Bruce

Can you have a look to this and see if it's an interesting addition to Max Box2D ?
http://www.box2d.org/forum/viewtopic.php?f=3&t=1664

I look forward this addition since a moment now. Fortunately I create my own buoyancy model with sensor but I'm wondering if this one is more practical and faster too.
In theory this is a controller and should be easily "pluggable" to the current version of Box2D.
There is also a tiny testbed example.

Tell me what you think about it when you have time :)
Thanks


Armitage 1982(Posted 2008) [#2]
I take a quick look to the Buoyancy controller C++ code.
It's a nice piece of code but this only workd with half infinite plane unlike my sensor area version (which is pretty slow compared to this one).
But as this controller is working with a list of interacting bodies it would be possible to create a sensor area that represent lakes in order to add and remove bodies to the buoyancy controller.

Normally this controller is just 2 files to add inside the dynamics controllers folder of Box2D sources.
Following your blitzmax wrapping method I could try to provide this addition to the SVN (commit ?) but I don't promise much since I'm not used to it ^^


Armitage 1982(Posted 2008) [#3]
Hum...
I didn't notice that buoyancy controller came with a set of others controllers inside the eponymous folder which may complicate the whole process !
Maybe too much of new objects to create...


Brucey(Posted 2008) [#4]
I'll have a look when I get the chance.

I wonder if it's likely for inclusion into the trunk (of box2d) at some point?


Armitage 1982(Posted 2008) [#5]
There is a todo features in box2d for buoyancy but it will only appear with version 3+ and there is still a very long list of features before that one.


Armitage 1982(Posted 2008) [#6]
Damned you right !
There is tiny modifications inside class b2Shape...
Mainly to add a step method and 2 utility functions.
Maintaining Box2d source will probably become difficult then.
Probably have to forget that one. Too bad cause there's very interesting additions in the box2d forum :(