Game Development Reference
In-Depth Information
The nominal value of lift coefficient is modified according to whether the flaps are deflected
or if ground effects are present. A simplified approach is taken to account for flap deflection. If
the flaps are deflected 20 degrees, the C L is increased by 0.25. If the flaps are deflected 40 degrees,
C L is increased by 0.5. In looking at Figure 10-11, the difference in C L for the NACA 2412 airfoil
for no-flap and 20-degree flap deflection is approximately 0.25.
If the plane is within 5 m of the ground, ground effects are assumed to be present and the
lift coefficient is increased by 0.5. Once C L has been determined, the lift force is computed
using Equation (10.3).
// Include effects of flaps and ground effects.
// Ground effects are present if the plane is
// within 5 meters of the ground.
if ( flap.equals("20") ) {
cl += 0.25;
}
if ( flap.equals("40") ) {
cl += 0.5;
}
if ( z < 5.0 ) {
cl += 0.25;
}
// Compute lift.
double lift = 0.5*cl*density*vtotal*vtotal*wingArea;
The next force to be computed is the drag force experienced by the airplane. The drag
coefficient and drag force are calculated using Equation (10.24). The cdp field represents the
parasitic drag coefficient.
// Compute drag coefficient.
double aspectRatio = wingSpan*wingSpan/wingArea;
double cd = cdp + cl*cl/(Math.PI*aspectRatio*eff);
// Compute drag force.
double drag = 0.5*cd*density*vtotal*vtotal*wingArea;
The thrust, lift, and drag forces that were computed in the preceding sections of code are
the forces parallel and normal to the velocity vector of the airplane. The x-, y-, and z-components
of the parallel and normal forces are determined based on the bank, heading, and climb angles
using a 3-D rotation matrix and Equation (10.35). The force of gravity, which always acts in the
vertical direction, is added to the z-direction force component.
// Define some shorthand convenience variables
// for use with the rotation matrix.
// Compute the sine and cosines of the climb angle,
// bank angle, and heading angle;
double cosW = Math.cos(bank); // Bank angle
double sinW = Math.sin(bank); // Bank angle
Search WWH ::




Custom Search