This demo shows a few scenes of my first 3D rigid body physics engine. This was the physics engine we used in Lux.
The entire engine was written by me and was heavily influenced by the paper “Non-convex Rigid Bodies with Stacking” by Guendelman et al.
To list a few specific details:
- Object integrator: Semi-implicit Euler
- Collision broad phase: Sweep and prune (or sort and sweep)
- Collision narrow phase: Separating axis theorem
- Collision resolution: Impulse-based resolution from Guendelman et al.
- Stacking: Contact graph and shock propagation method from Guendelman et al.
- Optimizations: Object sleeping using the same contact graph from stacking
- Ray tracing: Hierarchical AABB tree with triangles at the leaf nodes
I am currently in the process of making a second rigid body physics engine that will employ all the lessons I learned during the implementation of this engine. The goal of this second engine is to be stable and robust enough that I can easily swap in and out different algorithms for each phase of the physics, as well as to fix the issues that I had with this first engine. In particular, my implementation of SAT for collision detection in this engine produced fairly inconsistent collision records which resulted in my inability to support large stacks of blocks (though stacks of spheres worked just fine). While the collision detection solution was sufficient for Lux, I wasn’t satisfied enough with the results. Time constraints prevented me from being able to fix this issue in this first engine but it’s definitely something I’ll be keeping my eye on while I’m working on my second physics engine.