]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/YASim.cxx
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / YASim / YASim.cxx
index 9c260ce2b7e836e8fdb78da356f10fb8ba2504e4..febabc481bbc2dc51907f2e46103d3de7dc0f113 100644 (file)
@@ -91,10 +91,11 @@ void YASim::bind()
 
     char buf[256];
     for(int i=0; i<_fdm->getAirplane()->getModel()->numThrusters(); i++) {
-       sprintf(buf, "/engines/engine[%d]/fuel-flow-gph", i); fgUntie(buf);
-       sprintf(buf, "/engines/engine[%d]/rpm", i);           fgUntie(buf);
-       sprintf(buf, "/engines/engine[%d]/mp-osi", i);        fgUntie(buf);
-       sprintf(buf, "/engines/engine[%d]/egt-degf", i);      fgUntie(buf);
+       sprintf(buf, "/engines/engine[%d]/fuel-flow-gph", i);        fgUntie(buf);
+       sprintf(buf, "/engines/engine[%d]/rpm", i);                  fgUntie(buf);
+       sprintf(buf, "/engines/engine[%d]/mp-osi", i);               fgUntie(buf);
+       sprintf(buf, "/engines/engine[%d]/egt-degf", i);             fgUntie(buf);
+       sprintf(buf, "/engines/engine[%d]/oil-temperature-degf", i); fgUntie(buf);
     }
 }
 
@@ -142,9 +143,9 @@ void YASim::init()
        SGPropertyNode * node = fgGetNode("gear/gear", i, true);
         float pos[3];
         g->getPosition(pos);
-       node->setDoubleValue("xoffset-in", pos[0]);
-       node->setDoubleValue("yoffset-in", pos[1]);
-       node->setDoubleValue("zoffset-in", pos[2]);
+       node->setDoubleValue("xoffset-in", pos[0] * M2FT * 12);
+       node->setDoubleValue("yoffset-in", pos[1] * M2FT * 12);
+       node->setDoubleValue("zoffset-in", pos[2] * M2FT * 12);
     }
 
     // Are we at ground level?  If so, lift the plane up so the gear
@@ -207,7 +208,7 @@ void YASim::update(double dt)
 
     int i;
     for(i=0; i<iterations; i++) {
-        gr->setTimeOffset(iterations*_dt);
+        gr->setTimeOffset(i*_dt);
         copyToYASim(false);
         _fdm->iterate(_dt);
         copyFromYASim();
@@ -366,6 +367,7 @@ void YASim::copyFromYASim()
     double lat, lon, alt;
     sgCartToGeod(s->pos, &lat, &lon, &alt);
     _set_Geodetic_Position(lat, lon, alt*M2FT);
+    _update_ground_elev_at_pos();
 
     // UNUSED
     //_set_Geocentric_Position(Glue::geod2geocLat(lat), lon, alt*M2FT);