Erin Catto Crystal Dynamics Menlo Park, California ecatto@crystald.com February 22, 2005
Abstract This article introduces an iterative constraint solver for rigid body dynamics with contact. Our algorithm requires linear time and space and is easily expressed in vector form for fast execution on vector processors. The use of an iterative algorithm opens up the possibility for exploiting temporal coherence. A method for caching contact forces is presented that allows contact points to move from step to step and to appear and disappear. Examples are provided to illustrate the effectiveness of the algorithm.
1
Introduction
Recently, there has been much interest in using rigid body physics to enhance video games. Examples of rigid bodies in games are vehicles, rag dolls, cranes, barrels, crates, and even whole buildings. As more objects in the game world become physically based, realism and immersion are increased and the consumer has a more satisfying experience. Rigid body physics has moved from being a novelty to become a checklist feature in video game development. Developing a physics engine for games is a tremendous challenge. Many developers do not have the know-how and/or resources to develop general purpose physics engines, as witnessed by the recent growth in the physics middle-ware industry. A physics engine must have exceptional performance, far exceeding the levels 1
needed for off-line animation and research. The stability of physics simulation is vital because without stability the game play may become frustrating, ruining the player’s experience. Finally, the memory specifications of the current generation of consoles demands serious consideration of the physics engine memory footprint and cache usage. Fortunately, the performance and space requirements can be balanced by low accuracy requirements. As long as the motion is visually plausible, the physics programmer is free to modify the equations
References: [1] Mihai Anitescu and Florian A. Potra. Formulating dynamic multi-rigid-body contact problems with friction as solvable linear complementarity problems. Nonlinear Dynamics, 14:231–247, 1997. [2] David Baraff. Fast contact force computation for nonpenetrating rigid bodies. In Proceedings of SIGGRAPH 1994, pages 23–34, 1994. [3] J. Baumgarte. Stabilization of constraints and integrals of motion in dynamical systems. Computer Methods in Applied Mechanics and Engineering, 1:1–16, 1972. [4] Richard W. Cottle, Jong-Shi Pang, and Richard E. Stone. The Linear Complementarity Problem. Academic Press, 1992. [5] David H. Eberly. Game Physics. Morgan Kaufmann, 2003. [6] Gene H. Golub and Charles F. Van Loan. Matrix Computations. The Johns Hopkins University Press, 3rd edition, 1996. [7] Eran Guendelman, Robert Bridson, and Ronald Fedkiw. Nonconvex rigid bodies with stacking. In Proceedings of SIGGRAPH 2003, pages 871–878, 2003. [8] Ernst Hairer, Christian Lubich, and Gerhard Wanner. Geometric Numerical Integration. Springer-Verlag, 2002. [9] Thomas Jakobsen. Advanced character physics. In Proceedings of Game Developers Conference 2001, 2001. [10] Adam Moravanszky and Pierre Terdiman. Fast contact reduction for dynamics simulation. In Game Programming Gems 4, pages 253–263. Charles River Media, 2004. [11] Ahmed A. Shabana. Computational Dynamics. John Wiley and Sons, 2nd edition, 2001. [12] Russell Smith. Constraints in rigid body dynamics. In Game Programming Gems 4, pages 241–251. Charles River Media, 2004. [13] Russell Smith. Open dynamics engine. http://www.ode.org, 2004. 24