Game Development Reference
In-Depth Information
Buoyancy(const Vector3 &cOfB,
real maxDepth, real volume, real waterHeight,
real liquidDensity = 1000.0f);
/**
* Applies the force to the given rigid body.
*/
virtual void updateForce(RigidBody *body, real duration);
};
There is nothing to stop us from attaching multiple buoyancy force generators to
a boat, to represent different parts of the hull. This allows us to simulate some of the
shift in the center of buoyancy. If we have two buoyancy force generators, one at the
front (fore) and one at the rear (aft) of a boat, then as it pitches forward and back
(through waves, for example), the fore and aft generators will be at different depths
in the water and will therefore generate different forces. The highly submerged front
of the boat will pitch up rapidly and believably. Without multiple attachments, this
wouldn't look nearly as believable and may be obviously inaccurate.
For our sailing simulator we will use a catamaran with two hulls and four buoy-
ancy force generators: one fore and one aft on each hull.
The Sail, Rudder, and Hydrofoils
We will use aerodynamics to provide both the sail and the rudder for our boat. The
rudder is like the rudder on the aircraft: it acts to keep the boat going straight (or to
turn under the command of the player). On many sailing boats there is both a rudder
and a dagger board. The dagger board is a large vertical fin that keeps the boat moving
in a straight line and keeps it from easily tipping over when the wind catches the sail.
The rudder is a smaller vertical fin that can be tilted for turning. For our needs we
can combine the two into one. In fact, in many high-performance sailing boats the
two are combined into one structure.
The sail is the main driving force of the boat, converting wind into forward mo-
tion. It acts very much like an aircraft wing, turning air flow into lift. In the case of
a sailing boat the lift is used to propel the boat forward. There is a misconception
that the sail simply “catches” the air and the air drags the boat forward. This can be
achieved, certainly, and downwind an extra sail (the spinnaker) is often deployed to
increase the aerodynamic drag of the boat and cause it to be pulled along relative to
the water. In most cases, however, the sail acts more like a wing than a parachute. In
fact, the fastest boats can achieve incredible lift from their sails and travel considerably
faster than the wind speed.
Both the rudder and the sail are control surfaces: they can be adjusted to get the
best performance. They are both rotated rather than having pop-up control surfaces
to modify their behavior (although the sail can have its tension adjusted on some
boats). We will therefore implement a force generator for control surfaces using the