]> git.mxchange.org Git - flightgear.git/commitdiff
Set the RPM from the property tree with each iteration. This allows a
authordavid <david>
Sat, 18 Oct 2003 20:07:46 +0000 (20:07 +0000)
committerdavid <david>
Sat, 18 Oct 2003 20:07:46 +0000 (20:07 +0000)
YASim prop model to start with the prop spinning.

src/FDM/YASim/FGFDM.cpp

index 44ee1e8b39419d11365d0d84d4dc859f5ec6fd39..abe8843513fc500565dcfff9f10bc1abba7ca33d 100644 (file)
@@ -308,6 +308,8 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
 
 void FGFDM::getExternalInput(float dt)
 {
+    char buf[256];
+
     // The control axes
     ControlMap* cm = _airplane.getControlMap();
     cm->reset();
@@ -324,6 +326,17 @@ void FGFDM::getExternalInput(float dt)
        WeightRec* wr = (WeightRec*)_weights.get(i);
        _airplane.setWeight(wr->handle, LBS2KG * fgGetFloat(wr->prop));
     }
+
+    for(i=0; i<_thrusters.size(); i++) {
+       EngRec* er = (EngRec*)_thrusters.get(i);
+        Thruster* t = er->eng;
+
+       if(t->getPropEngine()) {
+            PropEngine* p = t->getPropEngine();
+            sprintf(buf, "%s/rpm", er->prefix);
+            p->setOmega(fgGetFloat(buf) * RPM2RAD);
+        }
+    }
 }
 
 void FGFDM::setOutputProperties()