Game Development Reference
Figure 3.12. Double loop of finding overlapped pairs.
Each SPU executes the process of finding the overlapping of AABBs and
DMA transfer in parallel with the double-buffering method because the AABB
array is just a simple array structure. When the number of necessary AABBs
becomes too small to use double buffering at a later stage of the process, we load
the rest of the AABBs to the local storage and execute processes one at a time.
For example, Batch 3 in Figure 3.12, includes only three AABBs.
The PPU has to allocate buffers where output pairs are stored before starting
tasks because SPUs can't allocate buffers in the main memory. Each SPU finds
overlapping pairs and then puts them back to the main memory when enough pairs
are stored in the local storage. After all overlapping pairs are found by SPUs, the
PPU gathers these pairs and merges them into one array.
3.4 Optimization of the Constraint Solver
Constraint is a condition that limits the behavior of a rigid body; it is used for
collision response or ragdoll joints in many real games. Often, impulses that
directly change the velocity of a rigid body are used to also control the behavior
of a rigid body. To solve the constraint condition for many related rigid bodies, the
general solution is to construct a huge matrix of linear equations and solve these
with an iterative method known as projected Gauss-Seidel (PGS) or sequential
impulse (SI) [Catto 05]. In this section, we don't describe the details of this
method but rather focus on how to optimize the solver computation for Cell/BE.
If needed, please refer to Chapter 2 for details.