
244 Chapter 11 The Rigid-Body Physics Engine
Our buoyancy force generator can be updated to take an attachment point;
otherwise, it is as befo re:
Excerpt from file include/cyclone/fgen.h
/**
* A force generator to apply a buoyant force to a rigid body.
*/
class Buoyancy : public ForceGenerator
{
/**
* The maximum submersion depth of the object before
* it generates its maximum buoyancy force.
*/
real maxDepth;
/**
* The volume of the object.
*/
real volume;
/**
* The height of the water plane above y=0. The plane will be
* parallel to the XZ plane.
*/
real waterHeight;
/**
* The density of the liquid. Pure water has a density of
* 1000 kg per cubic meter.
*/
real liquidDensity ...