Game Development Reference
In-Depth Information
// Call the ODE class constructor.
super(10);
// Load the initial values into the s field
// and q array from the ODE class.
setS(time);
setQ(vx0,0);
setQ(x0, 1);
setQ(vy0,2);
setQ(y0, 3);
setQ(vz0,4);
setQ(z0, 5);
setQ(massFlowRate,6);
setQ(initialMass, 7);
setQ(omega, 8); // d(theta)/dt in radians/s
setQ(theta, 9); // pitch angle in radians
// Initialize the values of the fields declared
// in the SimpleRocket class.
this.numberOfEngines = numberOfEngines;
this.seaLevelThrustPerEngine = seaLevelThrustPerEngine;
this.vacuumThrustPerEngine = vacuumThrustPerEngine;
this.rocketDiameter = rocketDiameter;
this.cd = cd;
this.initialMass = initialMass;
this.burnTime = burnTime;
// Initialize the atmosphere model.
air = new USatm76(z0);
}
The usual assortment of get/set methods are declared to return or change the values of the
location and velocity of the rocket and to return or change the values of the fields declared in
the SimpleRocket class. Not all of the get/set methods are shown here.
// These methods return the value of the fields.
public double getVx() {
return getQ(0);
}
public double getVy() {
return getQ(2);
}
// Other get/set methods not shown ...
Search WWH ::




Custom Search