Integrating rag doll physics
Particularly in the realm of computer games, attempting to pre-generate absolutely every bit of animation required by characters in a game is not always going to yield the most efficient use of developer's or artist's time.
Sometimes we want an animation to be able to react in real time to the environment around it and the introduction of a physics engine is a popular way of achieving that.
As writing a physics engine is complicated enough to warrant a number of books by itself, it's far more common for games to utilize third-party physics engines rather than for developers to construct their own.
With this in mind, the following recipe demonstrates how to integrate one specific physics engine in the hope that the general principles involved in integrating just about any of the other physics engines available will be indicated.
Getting ready
This recipe relies upon both the GeometricBuffer
classes discussed in Chapter 3, Procedural Modeling, and the BEPU physics...