Libgdx Box2D testbed

I found an hour today to continue working on porting over the original Box2D testbed tests. The ported testbed is very similar to the original one in it’s design. There’s a Box2DTest abstract class which handles things like creating all the rendering resources, mouse input and so on. All tests derive from this class and most often only implement the createWorld() method that populates the world with objects.

The class TestCollection ties all tests together and allows cycling through the tests by pressing the space bar.

Both things are pretty unexciting, porting the tests is also not really that impressive but rather tedious. The last piece in the puzzle is a renderer which can render the physics world. For this i wrote the Box2DDebugRenderer class, located in the main API so you can also use it when trying to debug your games. It uses an ImmediateModeRenderer internally so don’t expect the performance to be stellar.

Here’s a video of the tests ported so far. I could iron out a bug in the PrismaticJoint and a few other things along the way and all seems to work well. Richard of Rokon fame reported a bug in the default CollisionListener which i couldn’t reproduce. The CollisionFilters test also proves that my implementation of that is indeed correct. I could imagine that not being careful with your shorts (16-bit integer you pervert…) might be a problem in Java, so watch out for that.

Video footage taken on my trusty netbook with software OpenGL so the performance sucks a little 🙂

Libgdx 0.6 will be released on sunday with all those nice fixes. I hope to be able to port the rest of the tests over (won’t port raycasting and presolve tests yet though, that has to wait).

Contract & libgdx road map

I signed a contract today with Handmark, partner of a lot of OEMs and carriers, mainly in the U.S. from what i could gather. They will likely bundle it in some form with future Android devices, or publish it on their own market targeted at Sprint customers. No real details where given. In any case, any publicity is good publicity.

I know i’ve been kinda slow with additions to libgdx lately. Rest assured, i still work on it, albeit i only iron out some bugs and slowly but steadily increase the test coverage of Box2D. The next release (0.6) is scheduled for next sunday, it adds some small but important modifications to the Box2D wrapper along with a debug renderer for testing (which should only be used on the desktop! it’s slow on devices! TAKE NOTE!).

The future of libgdx looks as follows: i’ll add the mod player capability available in Andengine (yes, i too can “steal” code :)), add support for the TMX tile map format, clean up some dirty interfaces/classes (camera classes, i’m looking at you!), include the MD2 loader i wrote back in January for the tutorial (with fixes from Moritz, thanks!) and try my hands on a wrapper for Bullet. I’ll also stop being lazy and add a multitouch handler for Android so the pointer parameter of the InputListener methods are of actual use. Don’t expect any miracles on devices such as the N1 or Droid though, their touch screens still suck!

All this (expect the bullet wrapper) should be done by the end of august if all goes well and my work load at my day job decreases a little. I’d love to get some other people on the board which could help me out, but i guess the libgdx community is more or less non existant at this point 🙂