Looking for a good newtonian physics engine

Hey you guys, a’ve been working on a project, well, long story short I’m afraid I’m gonna have to build my own physics engine. That is - unless you guys could point me to a reasonable and already existing solution.

My requirements…

  • Open source. No way around this.
  • C++ interface. Python bindings would be nice but it’s not that big 'a deal to make my own.
  • The physics stuff - Newton dynamics. No fun ‘reduced-subset’ physics. Realism is what I’m going for.
  • Collision detection - preferably supporting non-convex arbitrary meshes, kinda like ODE’s TriMesh, only working outside of the land of fairies.

Thanks in advance :slight_smile:

ODE’s dead.
Newton should have pretty accurate stuff, but development is almost none
Tokamok’s dead.

Bullet is the best free open source Physics Engine right now, it’s even fully intergrated into Blender’s game engine.

Bullet’s also just an approximation (e.g. no central gravity field emulation).

B4 you start rewriting everything.
The file softbody.c in the blender sources has

  1. an adaptive step size 2nd order ODE integrator
  2. its own collision cache for detection on arbitrary meshes
  3. reacts on spheric force fields
  4. the code is more or less independent from the blender data structures /* except the “mesh_to_SB” and vice versa functions */

However there is no engine i know that can satisfy all needs.
Newton mechanics of free particles is the easiest part of it.
But as example there are a zillion ways to model viscoelastic collisions.
BM

Thank you for your pointers, bjornmose.

Basically the accuracy I’m aiming for is somewhere in the vicinity of Orbiter (orbit.medphys.ucl.ac.uk).

It’s open source, you can code in good, accurate, and fast simulation of what you want to do.

Bullet is the only open source Physics engine with active development, helping to develop the engine will be good for Blender’s BGE as it uses Bullet. It also helps in animation rendering as you can record the physics to IPO’s.

There are several approximational paradigms hardcoded in* (e.g. gravity is a dumb vector pointing down) that would take way too much work to modify. Not mentioning the mess it would probably lead to.

I’ve dissected several physics engines and saved interesting passages into my scrapbook, to get inspiration from. Right now I’m working on a runge-kutta integrator.

  • as in “the software is structured around these ideas”

Well, for small systems ( up to few 10 rigid bodies ) it seems to be reasonable to use some advanced predictor corrector type solver (e.g. Bulirsch Stoer) . They are harder to code and are way to big for calculating a little jiggle, but best for space simulation since they can be conditioned to be energy preserving.

CyborgDragon,

Bullet is the best free open source Physics Engine right now, it’s even fully intergrated into Blender’s game engine.

As of 2.48, it seems the record to IPO portion of the physics engine is broken. I have a complex model of a helicopter that I have broken into individual meshes. I have set them all as actors with bounds. When I record to IPO, the physics engine loses the initial placement and all the parts are in the wrong position on frame #1 after the record to IPO. This is a shame, because the system used to work.

I feel this is not the thread for reporting bullet bugs .
I doubt if it is blender related at all:)
so @ eridane,
I did my master in physics some days ( 15 * 365 approx ) before.
I might be better for all if you send a PM to me on your specific task, see if we can find a solution.