Game Development Reference
In-Depth Information
Chapter 9. Soft Body Dynamics
Soft bodies are an alternate type of collision object to rigid bodies; they deform as a
result of collisions and that allows us to simulate objects made from soft and malle-
able materials. In this chapter, we will be exploring the nuances of soft body physics
and adding a soft body to our scene.
Continue from here using the Chapter9_SoftBodyDynamics project files.
Soft body requirements
One way to think of soft bodies is having a non-rigid constraint on each vertex. When
one vertex is moved, the rest move with it, but not to the same extent, and each tries
to maintain their distance from their nearest neighbors, or in other words, maintain
their original pose. Thus, with a robust constraint system in place (like Bullet has), the
mathematics of soft bodies is essentially a larger scale version of the same concept.
There's a lot more that goes into the soft body physics simulation, but we don't need
a PHD in theoretical physics to add one to our simulation.
The btSoftRigidDynamicsWorld world object is required for soft body simulation.
This is a requirement since soft bodies are much more mathematically complex than
rigid bodies, and so an entirely different world is required to perform the work neces-
sary to move them through space and simulate them correctly.
In addition, this world also requires a slightly different collision configuration object
called btSoftBodyRigidBodyCollisionConfiguration , and an extra object
called btSoftBodyWorldInfo is an added attachment onto the soft body worlds,
which performs some extra initialization for our world to function.
Search WWH ::

Custom Search