ISBN 978-1-4666-1634-9 Chapter 8

Algorithmic and Architectural Gaming Design: Implementation and Development

Practical Introduction to Rigid Body LCP (Linear Complementary Problem) Constraint Solvers Ben Kenwright Newcastle University b.kenwright@ncl.ac.uk

(a)

Dr. Graham Morgan Newcastle University graham.morgan@ncl.ac.uk

(b)

(c)

Figure 1. Simulations to demonstrate stable stacking (a), articulated joints for characters (b) and chains of objects (c).

Theme: Physics-based Simulations Difficulty: Medium/Hard Implementation: Theory and Implementation in C/C++

Summary The chapter introduces Linear Complementary Problem (LCP) Solvers as a method for writing a robust realtime physics simulator, and will explain principles and algorithms with practical examples and reasoning. When first investigating and writing a solver, a person can easily get overwhelmed by the number of different methods and lack of implementation details, so the chapter will demonstrate the various methods from a no-nonsense point of view rather than a theoretical one, using code snippets and real test cases to help understanding.

Sections         

Introduction Collision information (Consistency and Manifolds) Jacobian and Constraints o Constraint Examples Linear Complementary Problem o Simplified Examples o Iterative Methods Implementation snippets, hacks and explanations Simulation Results (source code also available online) Sparse Matrices (introduction and example) Stability and Speed Parallelization

Overview With the ever increasing visual realism in today’s computer generated scenes, it should come as no shock that people also expect the scene to move and react no less realistically. With the computational power available today, the ability to run physically accurate real-time simulations is a must if you want to capture the audience’s attention.

Practical Introduction to Rigid Body Linear Complementary Problem (LCP) Constraint Solvers