Demonstration of a pile of objects falling into a corner using the 2D Rigid Body Physics Engine.
This is a good stress test for the physics engine. Click the add block button to add more blocks. Eventually the simulation will be unable to keep up with real time.
To see whether the simulation is keeping up with real time click the show clock button. The clock shows two second hands: the red hand tracks real time and the blue hand tracks simulation time. When the red hand is ahead of the blue hand it means the simulation has fallen behind real time.
The connected blocks checkbox includes two blocks that are connected by joints. Those are a good test of the ability to to keep joints together during a series of violent collisions.
Enabling the endless loop checkbox causes the simulation to be rebuilt every few seconds. The period is set by the loop time amount. This allows running the simulation over and over which is a good way to test the physics engine with many random situations.
The main performance challenge is when the blocks have settled down and are all lying in contact. Enable the show forces checkbox to see how hard the physics engine is working to figure out the many contact forces.
The physics engine performance is proportional to the the number of connected contacts raised to the fourth power. Here is an experiment that shows this:
Also available are: open source code, documentation and a simple-compiled version which is more customizable.
This web page was first published November 2016.