Hey all!
I’ve been out of the loop and out of doing games for fun for ages - what’s the current good options for 2d physics these days? Is Box2D still actively maintained?
Ta.
Hey all!
I’ve been out of the loop and out of doing games for fun for ages - what’s the current good options for 2d physics these days? Is Box2D still actively maintained?
Ta.
Yeah, looks to be the prime still.
Kev
I’ve found some.
There are all I could find. I didn’t use any of these even once.
Chipmunk looks pretty good if you’re there too.
Cheers,
Kev
I actually didn’t know even how to use one physics engine. Those are the top results from my google search “java physics engine 2d”
Box2D is great.
So I realise that my question was a bit ambiguous - when people say they’re using Box2d, do they mean JBox2d, or is there a jni binding to actual Box2d these days?
Or is JBox2d somehow kept in sync with the C++ code?
A lot of people use it through LibGDX - which natively binds to it I think, in the same way it binds to anything else.
Cheers,
Kev
Yeah I use Box2D via LibGdX.
Our Box2D impl uses JNI/C++, and has pretty much zero GC. Needed on Android, where JBox2D is just not an option. We use JBox2D for GWT, due to the lack of JNI there.
We also have a JNI/C++ Bullet physics wrapper, based on SWIG.
I was using JBox2D for Daedalus and I switched to LibGDX Box2d … I gained 10% in CPU usage for the whole game. So LibGDX’s binding seems to be really much faster than JBox2d
Edit: to me the only point in favor of JBox2d is that if you do something wrong you may have an exception or something like this, so it’s quite easy to debug. Moreover you have the sources which makes it even easier to debug/figure out what turned wrong. With Libgdx as it uses JNI you get a seg fault, and no way to debug.