Physics Engines in LibGDX

Update 2: Here is the source code for the JNI bullet engine in libgdx. Only the lib for android is included, so it won’t run on desktop (compile the bullet lib if you need it).


Update: I tried the c++ version of bullet over jni from here. This leads to an speed increase of around 10 times. For complex scenes this still doesn’t seem enough. You can try the Apk on your device here.


At the moment libgdx only supports Box2D as a physics engine. So I tried JBullet and jinngine to test the performance of 3D physics engines.

Sadly the performance of both physic engines isn’t good on android. JBullet is too slow and with jinngine dalviks garbage collector goes nuts. But anyway, here are some screenshots and the jars.

JBullet: Milestone: ~1 FPS

Ragdoll example in jinngine: Milestone: ~10 FPS


After realizing that the tested 3D physics engines are too slow for android devices I tried Box2D (which is buildin in libgdx) in a 3D environment. Box2D seems to run fast enough (around 5ms/frame with 100 cubes) to be used in a real game. I will try that in the future…

placeholder

Milestone: ~15fps at start and ~40fps if anything has settled