views:

286

answers:

2

I'm looking for a lightweight, pure Java physics engine to do some simulations for robotic motion control.

My requirements:

  • Rigid body physics
  • Joint constraints and forces
  • Convex object collision detection
  • Lightweight, pure Java so it can be embedded in my application
  • Ability to run simulations quickly
  • Handles 50-100 objects comfortably
  • Open source

Rather than reinventing the wheel, can you recommend any existing libraries that would fit the bill?

p.s. I have Googled already - I'm just keen to get honest opinions from people who have already used or implemented such things!

+2  A: 

I would also use JBullet, though its been a couple of years since I last worked with it.

troutinator
+6  A: 

I have used JBullet and JBox2D. They both are good libraries. JBox2D is more actively being changed, but JBullet has slightly larger base.

Just for fun, I was trying to simulate an old physics problem recently, for which I posted the results here.

Amrinder Arora
Thanks for the pointers! Were there any big differences between JBullet and JBox2D in terms of approach, capabilities or performance?
mikera
Also it looks like JBox2D is 2D only... may rule it out for some of my applications
mikera
Hmmm, I just found JBox2D to be easier to work with - but that was probably simply because the exact problem I was working with was more aligned to one of JBox2D examples. But yes, JBox2D is 2D only, and that may be a limiting factor.Btw, I found the performance of JBox2D *very* good - using with a 100 objects etc. A comparison of JBox2D with a different engine (Phys2D) can be found here: http://ciardhubh.de/node/15. That article does mention https://jmephysics.dev.java.net/ as a 3D engine candidate, but I have not worked with it.
Amrinder Arora