Game Development Reference
In-Depth Information
public class PropPlane extends SimpleProjectile
{
// Declare fields.
private double bank;
private double alpha; // Angle of attack
private double throttle;
private double wingArea;
private double wingSpan;
private double tailArea;
private double clSlope0; // Slope of Cl-alpha curve
private double cl0; // Intercept of Cl-alpha curve
private double clSlope1; // Post-stall slope of Cl-alpha curve
private double cl1; // Post-stall intercept of Cl-alpha curve
private double alphaClMax; // Alpha when Cl=Clmax
private double cdp; // Parasite drag coefficient
private double eff; // Induced drag efficiency coefficient
private double mass;
private double enginePower;
private double engineRps; // Revolutions per second
private double propDiameter;
private double a; // Propeller efficiency coefficient
private double b; // Propeller efficiency coefficient
private String flap; // Flap deflection amount
The PropPlane constructor calls the SimpleProjectile constructor to initialize the initial
location and velocity of the airplane. It then assigns values to the fields declared in the class
based on arguments passed to the constructor. Initially, the bank angle, angle of attack, throttle
setting, and flap deflection are all set to zero.
public PropPlane(double x, double y, double z,
double vx, double vy, double vz, double time,
double wingArea, double wingSpan, double tailArea,
double clSlope0, double cl0, double clSlope1,
double cl1, double alphaClMax,
double cdp, double eff, double mass,
double enginePower, double engineRps,
double propDiameter, double a, double b) {
super(x, y, z, vx, vy, vz, time);
this.wingArea = wingArea;
this.wingSpan = wingSpan;
this.tailArea = tailArea;
this.clSlope0 = clSlope0;
this.cl0 = cl0;
this.clSlope1 = clSlope1;
this.cl1 = cl1;
this.alphaClMax = alphaClMax;
Search WWH ::




Custom Search