+
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/misc/sg_path.hxx>
-#include <simgear/scene/model/location.hxx>
#include <simgear/scene/model/placement.hxx>
#include <simgear/xml/easyxml.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
-#include <Model/acmodel.hxx>
#include "FGFDM.hpp"
#include "Atmosphere.hpp"
node->setDoubleValue("yoffset-in", pos[1]);
node->setDoubleValue("zoffset-in", pos[2]);
}
-// for(i=0; i<m->numThrusters(); i++) {
-// // Sanify the initial input conditions
-// char buf[64];
-// sprintf(buf, "/controls/engines/engine[%d]/throttle", i); fgSetFloat(buf, 0);
-// sprintf(buf, "/controls/engines/engine[%d]/mixture", i); fgSetFloat(buf, 1);
-// sprintf(buf, "/controls/engines/engine[%d]/propeller-pitch", i); fgSetFloat(buf, 1);
-// sprintf(buf, "/controls/engines/engine[%d]/augmentation", i); fgSetFloat(buf, 0);
-// }
-
-// fgSetFloat("/controls/flight/slats", 0);
-// fgSetFloat("/controls/flight/spoilers", 0);
// Are we at ground level? If so, lift the plane up so the gear
// clear the ground.
fgSetBool("/controls/gear/gear-down", true);
}
- // The pilot's eyepoint
- float pilot[3];
- a->getPilotPos(pilot);
-// fgSetFloat("/sim/view/pilot/x-offset-m", -pilot[0]);
-// fgSetFloat("/sim/view/pilot/y-offset-m", -pilot[1]);
-// fgSetFloat("/sim/view/pilot/z-offset-m", pilot[2]);
-
// Blank the state, and copy in ours
State s;
m->setState(&s);
wind[1] = get_V_east_airmass() * FT2M * -1.0;
wind[2] = get_V_down_airmass() * FT2M * -1.0;
- // Get ground elevation from the FGinterface's FGlocation data
- double ground = getACModel()->get3DModel()->getSGLocation()->get_cur_elev_m();
+ // Get ground elevation
+ double ground = fgGetDouble("/position/ground-elev-m");
// cout << "YASIM: ground = " << ground << endl;
float pressure = fgGetFloat("/environment/pressure-inhg") * INHG2PA;
node->setBoolValue("wow", g->getCompressFraction() != 0);
node->setFloatValue("compression-norm", g->getCompressFraction());
}
-
- for(i=0; i<model->numThrusters(); i++) {
- SGPropertyNode * node = fgGetNode("engines/engine", i, true);
- Thruster* t = model->getThruster(i);
-
- node->setBoolValue("running", t->isRunning());
- node->setBoolValue("cranking", t->isCranking());
-
- float tmp[3];
- t->getThrust(tmp);
- node->setDoubleValue("prop-thrust", Math::mag3(tmp) * KG2LBS / 9.8);
-
- PropEngine* pe = t->getPropEngine();
- if(pe) {
- node->setDoubleValue("rpm", pe->getOmega() * RAD2RPM);
-
- pe->getTorque(tmp);
- float power = Math::mag3(tmp) * pe->getOmega();
- float maxPower = pe->getPistonEngine()->getMaxPower();
-
- node->setDoubleValue("max-hp", maxPower * W2HP);
- node->setDoubleValue("power-pct", 100 * power/maxPower);
- }
- }
}