Physics Demo Readme
About
Hi. This is a small demo of my physics engine. The demo cycles through several little scenes to give you a sense for what is possible with the engine.
What the engine does is simulate gravity as an external force on a set of rigid bodies, which are moved in response to it, and are kept from penetrating. Other effects such as friction are also implemented. The engine is based on David Baraff’s work, as stated in the demo itself. The solution to the nonpenetration constraints is arrived at through an elegant analytic method instead of simple penalty forces. This means that objects never interpenetrate. Currently, collision detection is based on oriented bounding boxes, instead of on the polygons themselves. Note that in this demo, no objects are ever put to ‚sleep‘ for the simple reason that I haven’t implemented that yet. This means that for all the objects you see on screen, all the contact forces are computed every frame.
The physics engine runs at 50Hz (these periods may eventually be further subdivided internally.) Since the computation of each step is based on the results of the previous, it is not possible to ‚skip frames‘ as in a graphics engine, when the computer executing the code cannot keep up. The result is that the simulation will slow down in this case. My personal system runs at 800Mhz with geForce 2 graphics board and 128 megs of ram. This system offers adequate power for most of the demo.
Note that while the demo simulated objects which are textured to look like stationary which have sizes on the order of centimeters in the real world, I choose to scale up the models to be on the order of a few meters. There are two reasons for this: If you drop a real ruler from a height of 30 cm, it will hit the floor faster than you can realize what is going on, and appreciate the nice physics. However, a hypothetical ruler the size of a small car will let you watch it fall for much longer, when dropped from a height of 30 meters. The other reason is that in games, an important application for such an engine, the typical object being simulated is the size of a car rather than a floppy.
Keys
Visualization:
mouse drag – camera
a/z – zoom
c -- show contact points and contact normals
b -- show bboxes
Simulation Speed:
r - as fast as possible
R - try to maintain 50Hz
s - advance frame by frame
Etc
--Adam Moravanszky
Zurich, Friday Dec 15 2000 (Revised: March 2002)