}
for(i=0; i<_controlProps.size(); i++)
delete (PropOut*)_controlProps.get(i);
+ delete _turb;
}
void FGFDM::iterate(float dt)
if(a->hasAttribute("epr")) j->setEPR(attrf(a, "epr"));
if(a->hasAttribute("exhaust-speed"))
j->setVMax(attrf(a, "exhaust-speed") * KTS2MPS);
+ if(a->hasAttribute("spool-time"))
+ j->setSpooling(attrf(a, "spool-time"));
j->setPosition(v);
_airplane.addThruster(j, mass, v);
float nrm = Math::mag3(v);
if (_vehicle_radius < nrm)
_vehicle_radius = nrm;
- v[0] = 0;
- v[1] = 0;
- v[2] = attrf(a, "compression", 1);
+ if(a->hasAttribute("upx")) {
+ v[0] = attrf(a, "upx");
+ v[1] = attrf(a, "upy");
+ v[2] = attrf(a, "upz");
+ Math::unit3(v, v);
+ } else {
+ v[0] = 0;
+ v[1] = 0;
+ v[2] = 1;
+ }
+ for(int i=0; i<3; i++)
+ v[i] *= attrf(a, "compression", 1);
g->setCompression(v);
g->setBrake(attrf(a, "skid", 0));
g->setStaticFriction(attrf(a, "sfric", 0.8));
l->setHoldbackMount(v);
float length = attrf(a, "length", 1.0);
l->setLength(length);
- l->setDownAngle(attrf(a, "down-angle", 30) * DEG2RAD);
- l->setUpAngle(attrf(a, "up-angle", -30) * DEG2RAD);
+ l->setDownAngle(attrf(a, "down-angle", 45) * DEG2RAD);
+ l->setUpAngle(attrf(a, "up-angle", -45) * DEG2RAD);
+ l->setHoldbackLength(attrf(a, "holdback-length", 2.0));
_airplane.addLaunchbar(l);
} else if(eq(name, "fuselage")) {
float b[3];
node->setFloatValue("mp-inhg", pe->getMP() * (1/INHG2PA));
node->setFloatValue("egt-degf",
pe->getEGT() * K2DEGF + K2DEGFOFFSET);
+ node->setFloatValue("oil-temperature-degf",
+ pe->getOilTemp() * K2DEGF + K2DEGFOFFSET);
node->setFloatValue("boost-gauge-inhg",
pe->getBoost() * (1/INHG2PA));
} else if(p->getEngine()->isTurbineEngine()) {
node->setFloatValue("n1", j->getN1());
node->setFloatValue("n2", j->getN2());
node->setFloatValue("epr", j->getEPR());
- node->setFloatValue("egr-degf",
+ node->setFloatValue("egt-degf",
j->getEGT() * K2DEGF + K2DEGFOFFSET);
// These are "unmodeled" values that are still needed for
w->setTaper(attrf(a, "taper", 1));
w->setDihedral(attrf(a, "dihedral", defDihed) * DEG2RAD);
w->setCamber(attrf(a, "camber", 0));
- w->setIncidence(attrf(a, "incidence", 0) * DEG2RAD);
- w->setTwist(attrf(a, "twist", 0) * DEG2RAD);
+
+ // These come in with positive indicating positive AoA, but the
+ // internals expect a rotation about the left-pointing Y axis, so
+ // invert the sign.
+ w->setIncidence(attrf(a, "incidence", 0) * DEG2RAD * -1);
+ w->setTwist(attrf(a, "twist", 0) * DEG2RAD * -1);
// The 70% is a magic number that sorta kinda seems to match known
// throttle settings to approach speed.
float mul = attrf(a, "turbo-mul");
float mp = attrf(a, "wastegate-mp", 1e6) * INHG2PA;
eng->setTurboParams(mul, mp);
+ eng->setTurboLag(attrf(a, "turbo-lag", 2));
}
+ if(a->hasAttribute("supercharger"))
+ eng->setSupercharger(attrb(a, "supercharger"));
+
((PropEngine*)_currObj)->setEngine(eng);
}
PropEngine* thruster = new PropEngine(prop, eng, moment);
_airplane.addThruster(thruster, mass, cg);
+ // Set the stops (fine = minimum pitch, coarse = maximum pitch)
+ float fine_stop = attrf(a, "fine-stop", 0.25f);
+ float coarse_stop = attrf(a, "coarse-stop", 4.0f);
+ prop->setStops(fine_stop, coarse_stop);
+
if(a->hasAttribute("takeoff-power")) {
float power0 = attrf(a, "takeoff-power") * HP2W;
float omega0 = attrf(a, "takeoff-rpm") * RPM2RAD;
if(eq(name, "CYCLICELE")) return ControlMap::CYCLICELE;
if(eq(name, "ROTORENGINEON")) return ControlMap::ROTORENGINEON;
if(eq(name, "REVERSE_THRUST")) return ControlMap::REVERSE_THRUST;
+ if(eq(name, "WASTEGATE")) return ControlMap::WASTEGATE;
SG_LOG(SG_FLIGHT,SG_ALERT,"Unrecognized control type '"
<< name << "' in YASim aircraft description.");
exit(1);