Box2D for BlitzMax

Community Forums/Showcase/Box2D for BlitzMax

Brucey(Posted 2008) [#1]
I'm pleased to announce BaH.Box2D, a wrapper for the Box2D physics engine.

Box2D is the base from which many of the other 2D engines are derived.

As usual, the module is free, cross-platform, fully documented and comes with lots of examples demonstrating many of the features.


The module is available at the maxmods site.

You can download it from HERE.


If you have any problems or general comments, feel free to post them in my modules forum here.

:o)

Enjoy!


Htbaa(Posted 2008) [#2]
Very cool stuff!

test.bmx doesn't seem to compile though. Lots of (code+0x158): undefined reference to `bah_box2d_????' type of errors. I guess it doesn't import the right sections?

The rest of the examples do compile though. It's very impressive.


markcw(Posted 2008) [#3]
Brucey is like a machine. :)

Can I ask how long that took you?


Brucey(Posted 2008) [#4]
@htbaa
test.bmx is just part of the examples "framework", as is render.bmx. So nothing to worry about there :-)

@markcw
Not too long. On and off since the first commit (March 30), during which time I've moved continents, been without internet/decent computer for a while, and worked on some other modules and apps. I was also working with Box2D's latest SVN, which caused a few changes along the way, as I adapted to changes in its API (note to self - work with stable versions if you want an easier life!)
So, all in all, not too long really, given the size of the API ;-)


Armitage 1982(Posted 2008) [#5]
:)

That was so fast !

It's a good day for BlitzMax users :D
We are about to see much of interesting stuff in few months I think.

By the way, did you find a trick with bitmask collision group/categories ?
Just to warn others if needed ;)

Thanks again !


Htbaa(Posted 2008) [#6]
I think it's really cool that there are now 3 physics modules for BlitzMax. Chipmunk, Farseer and Box2D. Not so cool is that it's now tougher to choose which one to use!


Brucey(Posted 2008) [#7]
did you find a trick with bitmask collision group/categories ?

Just gave it some quality time, and I think I've solved it. Check out the latest code to see if the example is doing what I think it should be now. (all small shapes collide with everything, large shapes don't collide with each other. large rect doesn't collide with triangles at all ??)

here are now 3 physics modules

and of course there's also that PhysLite, although it's not as free as those other three.


Htbaa(Posted 2008) [#8]
Hadn't heard of that one yet.

Now you've done Chipmunk and Box2D, have you got any idea which one is easier to use or perhaps faster?


therevills(Posted 2008) [#9]
EDIT: NVM, found the answer here:
http://code.google.com/p/maxmods/wiki/HowToInstallModules


How do you get this to work?

Ive tried putting the "box2d.mod" folder in \brl.mod and \pub.mod, then build modules, but I get the following error each time:


Compiling:box2d.bmx
Compile Error: Module does not match commandline module
[C:/Program Files/BlitzMax/mod/brl.mod/box2d.mod/box2d.bmx;26;18]
Build Error: failed to compile C:/Program Files/BlitzMax/mod/brl.mod/box2d.mod/box2d.bmx



It points to box2d.bmx and the line with "Module BaH.Box2D"



Armitage 1982(Posted 2008) [#10]
Indeed Brucey !
Collision filtering work perfectly now ^^

Thank you again :)

@Htbaa
I recommend Box2D for features/stability/speed/community


Hammlet(Posted 2008) [#11]
i have a problem with installing.
I save the Mods in .....BlitzMax/mod/bah.mod/ xxx.mod,
-->http://code.google.com/p/maxmods/wiki/HowToInstallModules

but nothing works.

Compile Error
Can't find interface for module 'bah.chipmunk'

where is the fault??


slenkar(Posted 2008) [#12]
do you gave mingw installed and rebuilt modules?


Hammlet(Posted 2008) [#13]
i have re-installet blitzmax, and now chipmunk works, but Box2D not, the same Error. Rebuilt modules didn't work, error: failed to compile C:/Program Files/BlitzMax/mod/brl.mod/blitz.mod/blitz_app.c
What is mingw??


Brucey(Posted 2008) [#14]
Ahh... I guess I should also ship a pre-compiled box2d, like I do with chipmunk...


plash(Posted 2008) [#15]
Hammlet: You need to get MinGW and set it up to compile modules that use C++/C code.

http://www.blitzmax.com/Community/posts.php?topic=53442


Hammlet(Posted 2008) [#16]
Thanks a lot, it works!! :-)