]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/YASim.cxx
Interpolate the twist linearly over the wing.
[flightgear.git] / src / FDM / YASim / YASim.cxx
index efa82483825f154c063c1c657adf42954d6ac8fa..f8c109abd27be3cf2cb89ac5cb8286e80abfb862 100644 (file)
@@ -3,6 +3,9 @@
 #include <simgear/xml/easyxml.hxx>
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
+#include <Model/acmodel.hxx>
+#include <Model/model.hxx>
+#include <Main/location.hxx>
 
 #include "FGFDM.hpp"
 #include "Atmosphere.hpp"
@@ -86,7 +89,7 @@ void YASim::report()
     float cg[3];
     char buf[256];
     a->getModel()->getBody()->getCG(cg);
-    sprintf(buf, "            CG: %.1f, %.1f, %.1f", cg[0], cg[1], cg[2]);
+    sprintf(buf, "            CG: %.3f, %.3f, %.3f", cg[0], cg[1], cg[2]);
     SG_LOG(SG_FLIGHT, SG_INFO, buf);
 
     if(a->getFailureMsg()) {
@@ -386,7 +389,12 @@ void YASim::copyFromYASim()
     _set_Accels_CG_Body(M2FT*v[0], -M2FT*v[1], -M2FT*v[2]);
 
     _fdm->getAirplane()->getPilotAccel(v);
-    _set_Accels_Pilot_Body(M2FT*v[0], M2FT*v[1], -M2FT*v[2]);
+    _set_Accels_Pilot_Body(-M2FT*v[0], M2FT*v[1], M2FT*v[2]);
+
+    // There is no property for pilot G's, but I need it for a panel
+    // instrument.  Hack this in here, and REMOVE IT WHEN IT FINDS A
+    // REAL HOME!
+    fgSetFloat("/accelerations/pilot-g", -v[2]/9.8);
 
     // The one appears (!) to want inverted pilot acceleration
     // numbers, in G's...
@@ -430,10 +438,6 @@ void YASim::copyFromYASim()
        node->setBoolValue("running", t->isRunning());
        node->setBoolValue("cranking", t->isCranking());
 
-        // Note: assumes all tanks have the same fuel density!
-       node->setDoubleValue("fuel-flow-gph", CM2GALS * t->getFuelFlow()
-                            / airplane->getFuelDensity(0));
-
         float tmp[3];
         t->getThrust(tmp);
        node->setDoubleValue("prop-thrust", Math::mag3(tmp) * KG2LBS / 9.8);