Game Development Reference
In-Depth Information
Terminal Velocity
Before we start to code up aerodynamic drag effects, let's take a little detour to discuss an inter-
esting feature of aerodynamic drag. As we have seen, aerodynamic drag resists the motion of
an object through the air and is proportional to the square of the velocity of the object. Because
aerodynamic drag increases with the square of the velocity, drag will oftentimes be a limiting
factor in how fast an object can travel.
Returning to our parachuting example, when the parachutist jumps out of the airplane the
velocity of the parachutist increases over time, as does the drag force, until a point is reached
where the aerodynamic drag exactly balances the force of gravity. At this point, there is no net
force on the parachutist, and velocity of the parachutist remains constant. The velocity at which
drag is equal to gravity is called the terminal velocity .
It isn't necessary to use an ODE solver to compute terminal velocity; a simple force balance
will suffice. Terminal velocity occurs when the force of gravity on an object is equal to the
drag force.
1
--- rv 2 AC D
mg
=
(5.21)
Equation (5.21) can be rearranged in terms of the velocity where the force balance occurs.
2 mg
rAC D
v
=
--------------
(5.22)
In order to minimize terminal velocity, you want to either minimize mass or maximize
density, area, or drag coefficient. When a parachute is opened, it increases the characteristic
area, A , and the drag coefficient, C D , that is experienced by the parachutist and allows her to
float gently down to Earth.
Programming Drag Effects into the Projectile Trajectory Model
It's time to write a class called DragProjectile that will represent a projectile that is subject to
the forces of gravity and aerodynamic drag. Adding drag effects to the projectile trajectory model
is actually quite simple because we can reuse much of the code from the SimpleProjectile and
ODE classes by making the DragProjectile class a subclass of SimpleProjectile . The
DragProjectile class will have access to the methods declared in the SimpleProjectile and ODE
classes and only needs to declare fields for the projectile mass, air density, characteristic area,
and drag coefficient that will be used in the drag force equation.
public class DragProjectile extends SimpleProjectile
{
private double mass;
private double area;
private double density;
private double Cd;
The DragProjectile constructor is quite simple. It calls the SimpleProjectile constructor,
passing it initial values for the location and velocity components of the projectile. It then
initializes the values of the fields declared in the DragProjectile class.
Search WWH ::




Custom Search