Game Development Reference
F IGURE 11.2
Different centers of buoyancy.
at its maximum. It doesn't increase with further depth. This is an approximation
because it doesn't take into account the shape of the object being submerged.
Originally the force directly acted on the particle. This is fine for representing
balls or other regular objects. On a real boat, however, the buoyancy does two jobs: it
keeps the boat afloat, and it keeps the boat upright. In other words, if the boat begins
to lean over (say a gust of wind catches it), the buoyancy will act to right it.
This tendency to stay upright is a result of the torque component of the buoyancy
force. Its linear component keeps the boat afloat, and its torque keeps it vertical. It
does this because, unlike in our particle force generator, the buoyancy force doesn't
act at the center of gravity.
A submerged part of the boat will have a center of buoyancy, as shown in fig-
ure 11.2. The center of buoyancy is the point at which the buoyancy force can be
thought to be acting. Like the buoyancy force itself, the center of buoyancy is related
to the displaced water. The center of mass of the displaced water is the same as the
center of buoyancy that it generates.
So, just as the volume of water displaced depends on the shape of the submerged
object, so does the center of buoyancy. The farther the center of buoyancy is from the
center of mass, the more torque will be generated and the better the boat will be at
righting itself. If the center of mass is above the center of buoyancy, then the torque
will apply in the opposite direction and the buoyancy will act to topple the boat.
So how do we simulate this in a game? We don't want to get into the messy details
of the shape of the water being displaced and finding its center of mass. Instead we