Box2D 2.1.0

BlitzMax Forums/Brucey's Modules/Box2D 2.1.0

Armitage 1982(Posted 2010) [#1]
Hoo the precious is finally there :D

Any plans to support it via a new module ?
New manual and all :) http://www.box2d.org/manual.html

Hope there isn't too much changes.


Tommo(Posted 2010) [#2]
Hooray!
There're some new features I've been looking forward to. (kinematic body & unlimited world size & polygon decomposition ...)


Space_guy(Posted 2010) [#3]
Very cool! :)


Armitage 1982(Posted 2010) [#4]
I'm very enthusiast about the new contact collision solver.
I would be able to create single surface platforms like you can see in every platform games.
That would fix a bug in my current one way field.

The only real modification I see for instance is a new way to set Box2D type body and fixture :

b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
bodyDef.position.Set(0.0f, 4.0f);
b2Body* body = world.CreateBody(&bodyDef);


New objects like b2_dynamicBody, b2WorldManifold, b2Fixture etc. could represent a huge source of code breaking.
I cannot get an idea of the amount of work to upgrade to this needed version.

I also hope that the new code won't affect the physic simulation too much.


Brucey(Posted 2010) [#5]
I'll try and make some room this weekend and see how far I get with it.


Armitage 1982(Posted 2010) [#6]
Sweet :)
Thanks


Robert Cummings(Posted 2010) [#7]
There's a few gotchas with a different setup (you don't need to define the world limits any more) and of course you need to build bodies differently.

You have bodies, shapes and fixtures now. The fixture is what links the shapes to the bodies. Just heads up.


Steffenk(Posted 2010) [#8]
If the new contact collision solver makes single-surface plattformer levels possible, that would be really great. I could finally continue a project i had abandoned long ago..


Armitage 1982(Posted 2010) [#9]
If the new contact collision solver makes single-surface plattformer levels possible, that would be really great. I could finally continue a project i had abandoned long ago..


Yes, I thing there's an example in the official bedroom for this :)

you don't need to define the world limits any more


Nice modification indeed!
There is probably many others tiny bits to optimize with this new version.


Armitage 1982(Posted 2010) [#10]
Hi Brucey

Did you find any free time lately to check this new release ?
What do you think about it :)


Steffenk(Posted 2010) [#11]
An update would be really nice indeed.

I'm also currently trying to draw the bodies/shaped on screen by extracting their bounding boxes (they're rectangular anyways), but it seems there is currently no way to do that. I know there's b2DebugDraw but i'd like to have some more control on the way it's drawn.

I tried b2Shape.ComputeAABB() with an identity b2XForm, but it keeps giving me crashes. It's also difficult to access the 2 vectors of the resulting AABB from BMax, as there is no GetLower/Upperbound function, only SetLower/Upperbound. So that'd be nice to have in future versions.

Thanks for your effort, btw. Without libxml, box2d, wxwidgets etc. many of my projects wouldn't 've been possible.


Armitage 1982(Posted 2010) [#12]
I think you could try to use these functions :

'Shape is your b2shape object
'OBB is an oriented bounding box 
Local OBBExtent:b2Vec2 = shape.GetOBB().GetExtents()
Local OBBExtentX:Float = OBBExtent.GetX()
Local OBBExtentY:Float = OBBExtent.GetY()


I don't mess with the ComputeAABB() I think it's low level Broadphase stuff and generally you should now your Axis Aligned Bounding Box in order to queries the worldAABB for InRange command or something.

I know a lot of low level and quicker stuff are already possible with the new version of Box2d. Can't wait for this one too :-)


Robb(Posted 2010) [#13]
Is the syntax of the update much different to the previous version?

The reason I ask is that I am about to embark on a physics based project and I'm not sure whether or not I should start using the current box2D and try to upgrade later or just wait and see if Brucey updates the module for the newer version.


Armitage 1982(Posted 2010) [#14]
The syntax will stay the same BUT the underlying logic will change a bit with the addition of fixture between shape and object as well as a new collision filtering.

My biggest fear is indeed revamp my whole physical layer in order to use this new version of Box2D.
I still don't know if the various optimisation in 2.1.2 will disturb my current Setup since I already precisely define most of the physical values.

I know I need some of the new features to fix a behaviour in my game, so if I were you I would probably start building a proof of concept or a prototype before developing the whole project right now. Except maybe if it's something relatively small.

One good thing with the current version is that everything seems to work greatly and as been tested by a few Blitzmax people.

The new version shall be defined in a whole new module. Starting from zero will probably take some times before you see something usable.


Robert Cummings(Posted 2010) [#15]
Anyone feel like taking this on? I'd be interested in using bmax for pc and mac for next game then


Space_guy(Posted 2010) [#16]
Any progress with this? Would be very nice to work with new version.


Space_guy(Posted 2011) [#17]
Well now that your back Brucey, do you have any plans to update this?