Game Development Reference
In-Depth Information
Figure 5-28.
Gravity grid with one cube added
Now, let's add the other cube to the gravity grid. Go to the
UpdateGravityGrid()
function and add
the following line:
m_Grid.AddMass(m_Cube2);
This adds the second cube to the gravity grid. You should see something similar to Figure
5-29
. Note
that the color of the spotlight under the grid has changed, and the grid generally seems to be higher
because of the addition of the new mass.
Figure 5-29.
Gravity grid with two cubes added