I have a simple game with 20-30 physics bodies (static, and dynamic)

If I add some additional Dynamic bodies and joints (over 80-90 item), then JBox2D will become very laggy, and a little slow.

Am I doing something wrong, or is this the limit of JBox2D? If I change to Box2D JNI via java native calls, will it be faster?

  • 4
    \$\begingroup\$ I have no idea what hardware you are running on, but I think for a mobile game, that might be too much for most phones to handle. \$\endgroup\$ May 9 '11 at 22:09
  • 2
    \$\begingroup\$ Joints are generally quite expensive to use too I believe. \$\endgroup\$ Oct 7 '11 at 9:13

Response for Android devices. Jbox2D is so bad... Since NDK is available, i use it with native Box2D. January 2010, there was a 3X factor without garbage collector lags. There is many NDK ports as in libGDX

note: With 2.3 devices, the new GC fixes lags...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.