Tim's Portfolio
![](/static/img/physics/bods.png)
Shown above is a screen capture from my rigid body dynamics simulator, written in C++. The simulator allows arbitrary convex polygons to move and collide in 2D space.
Collisions and joints are supported. The simulation engine relies on an iterative local solver which solves constraints such as non-penetration and fixed-distance constraints at the level of impulses. Working at the level of impulses uses only the first time derivative, and using a local solver allows for a much simpler implementation for things like inequality constraints.
Other features include friction, immoveable solids, post-stabilization, and the ability to apply arbitrary forces and impulses, which is useful for a physics-based video game.
Recordings of the physics engine in action are shown in the adjacent pages.
Acknowledgements
This engine is heavily inspired by the Sequential Impulses Method proposed by Erin Catto, author of the popular Box2D Physics Library. Erin Catto has published a number of highly informative resources at the Box2D website for physics programming which I am grateful for.
Additionally, Nilson Souto has written a three-part series on physics programming and constraint solving which, while working at the level of forces and focusing on the second time derivative, is very useful for thinking about constraints geometrically and mathematically.
Source Code
The source code for my physics engine is available on GitHub .