
234 Chapter 11 The Rigid-Body Physics Engine
registry.updateForces(duration);
// Then integrate the objects.
integrate(duration);
}
It no longer calls the collision detection system. The calls to startFrame and
runPhysics can occur in the same place in the game loop.
Note that I’ve made an additional call to the updateTransform method of each
object. The object may have moved during the update (and in later sections during
c o l l ision resolution), so its transform matrix needs updating before it is rendered.
Each object is then rendered in turn using the rigid body’ s transform.
11.2 Using the Physics Engine
Both our sample programs for this physics