This is a very simple C# implementation of a Physics Engine (using that term very loosely). If you're looking for a robust engine to use in your own project, then you should look at the Bullet engine, ODE or Box2D. If you're coming to grips with learning how physics engines work, or writing your own engine, then hopefully this should prove useful. This is a hotchpotch of articles and blog posts with tutorials on OpenGL, unit testing, whilst building a very simple C# Physics engine and OpenGL 3D engine.
Do you find these tutorials useful? I could do with some feedback; I've got good feedback from Tutorial 1 (which in my opinion is the most accessible of the tutorials), but have no feedback on the others. As it's still early days, you can push me to write in the direction you're interested in! What do you think is good, what do you think is bad? Spotted any mistakes? What future direction do you want the tutorials to take (are you happy with the roadmap)? More explanation of the Physics? More OpenGl? A Microsoft.XNA client? Email jabuka AT taumuon.co.uk with your comments!
Tutorial 0. Background information. Installing the Tao Framework. Tutorial0_v2.pdf
Tutorial 1. A tutorial on creating a simple 3D OpenGL application in Visual Studio 2005 Express, and an introduction to the Tao Framework (using the SimpleOpenGlControl). Is simultaneously on object-oriented design, UML and refactoring.
Tutorial1_v4.pdf.Tutorial1_v4Code.zip
Tutorial 1 version 4 includes a section on IDisposable and Finalization. The old version of Tutorial 1 is available Tutorial1_v1.pdf, and code Tutorial1_v1Code.zip. I've kept this available in case you're interested in setting up OpenGL to work with GLFW.
Version 3 included minor bug fixes. Thanks to Ryan McFall from the TaoFramework.com forums, and Geo Massar for their feedback.
There were numerous changes in version 2, thanks to okakiguy from the Tao Framework mailing list for the excellent review and suggestions.
Tutorial 2. This is a tutorial on using NUnit, and on Test-Driven Development, being used to develop a very simple C# Physics engine (getting an object to move under force using semi-implicit Euler integration). Also covers C# operator overloading.
Tutorial2_v1.pdf.Tutorial2_v1Code.zip
Tutorial 3. This is a tutorial in the consuming of the very simple Physics engine developed in the last tutorial by the 3D engine. (Briefly covers favouring composition over inheritance).
Tutorial3_v1.pdf.Tutorial3_v1Code.zip

Covers simple 3D sphere-sphere collision detection and inelastic collision response (no stacking, no rotations, no resting constraints).
Use of custom attributes and reflection for scene loading. Included scenes demonstrate transfer of momentum, shock propagation (Newton's cradle) and multiple simultaneous collisions.
Testing demonstrates use of MockObjects to isolate dependencies, use of generic types.
Tutorial4_v1.pdf.Tutorial4_v1Code.zip
Tutorial 5. This tutorial covers a quaternion implementation, but more importantly, shows an example of how to use quaternions.
Additionally, the unit tests provided should a reference for anybody to else to compare their quaternion implementation against.
Tutorial5_v1.pdf.Tutorial5_v1Code.zip
Version 0.6. Due to lack of time I'm moving over to a blog-based approach (to speed up development), I'll concentrate on blogging on interesting bits of code. This release is a slight departure of the roadmap, in that it implements some steering behaviour, and simple flocking (based on Craig Reynolds boids behaviour) - check the blog for updates within the next few days. The code is available for download.
Version 0.7. This changes the collision response algorithm to use Erin Catto's Sequential Impulses. The code itself is a (very imcomplete) port to 3D and C# of the simplified Box2DLite application, with the sphere collision and restitution code taken from Box2D. The missing features include joints, friction, rotation, etc, but the main SI algorithm is working. The code is available for download.
Last updated 4th August 2008
All UML diagrams drawn with the excellent free UMLet tool (http://www.umlet.com/.)
Copyright Gary Evans 2006-2008