A working physics engine package?

I’ve been trying to find a working physics engine library, but it seems that the ports of Box2D and Chipmunk are out of date. There is RigidBodyDynamics, but as far as I can tell it doesn’t support collisions and contacts? I know that Julia is not really used in game development, but I would like to simulate a few boxes colliding with each other. It seems interesting to me that there are multiple quantum physics and nonlinear dynamics packages, but not a meager box2d :smiley:

2 Likes

I mean, you’d just call a differential equation library for things like that.

1 Like

Writing your own Box2D wouldn’t be difficult. :slight_smile: I have a handful of routines that would be useful for that. But I bet there’s a lot of the functionality buried in the geometry and otherwise packages. Might take a little prodding.

well that was just an example actually, surely a complete physics engine with constraints, joints and continous collisions is not readily doable with differential equations?

No, that was an example of a domain specific differential equation solver… this is literally just DAEs with events, which is how it’s normally done in the large-scale frameworks.

Anyways. The ones that I know about so far are RigidBodySim.jl

https://github.com/JuliaRobotics/RigidBodySim.jl

or Modia3D.jl:

https://github.com/ModiaSim/Modia3D.jl

Both of which just build calls to differential equation solvers of course. Both do contacts of course, since that’s just a differential algebraic equation. I know Modia does collusion handling and I’m not sure if RigidBodySim.jl does but you’d just write a standard DifferentialEquations.jl callback to add it to the library so it wouldn’t be hard to add.

When you say physics engine, do you mean a “game physics” engine, or “real physics” engine?
And what sort of engine: from some remarks I take it it is Newtonian dynamics?

What exactly would you like to accomplish?

2 Likes

Since they mentioned Box2d, they are looking for a “game physics” engine.

Which means it focuses on simulating large numbers of convex objects in collision with friction at hyper real-time rates. < 16ms sim time for thousands of bodies. Typically the differential equation part of it is trivial, you just use symplectic Euler, which is a couple of lines of code.

I’ve looked for one, but haven’t found anything.

2 Likes

Just to further clarify “physics engine”, here is a brief explanation from Box2D wikipedia page:

Box2D performs constrained rigid body simulation. It can simulate bodies composed of convex polygons, circles, and edge shapes. Bodies are joined together with joints and acted upon by forces. The engine also applies gravity, friction, and restitution.

Are you just looking for a 2D ( games ) physics engine?
(or N-dimensional Marc ten Bosch - N-Dimensional Rigid Body Dynamics)

I’m slowly working a 3D one, but my time is limited, so might be awhile before it’s useful. There is some overlap for the algorithms you’d choose for 2D and 3D, but efficient collision detection, angular constraints and visualization are totally different for the two. But hey, multiple dispatch!

3 Likes