]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/Propeller.cpp
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / YASim / Propeller.cpp
index fd6a9d4bf24a5f81d46be37b1a80d58678f663a6..a49f0dad8205b04fb3ceb780b87661d207a63a21 100644 (file)
@@ -24,6 +24,7 @@ Propeller::Propeller(float radius, float v, float omega,
     _matchTakeoff = false;
     _manual = false;
     _proppitch = 0;
+    _propfeather = 0;
 }
 
 void Propeller::setTakeoff(float omega0, float power0)
@@ -55,6 +56,12 @@ void Propeller::setPropPitch(float proppitch)
     _proppitch = Math::clamp(proppitch, 0, 1);
 }
 
+void Propeller::setPropFeather(int state)
+{
+    // 0 = normal, 1 = feathered
+    _propfeather = (state != 0);
+}
+
 void Propeller::calc(float density, float v, float omega,
                     float* thrustOut, float* torqueOut)
 {
@@ -62,7 +69,7 @@ void Propeller::calc(float density, float v, float omega,
     // 0.25 and 4.  A prop pitch of 0.5 results in no change from the
     // base value.
     if (_manual) 
-        _j0 = _baseJ0 * Math::pow(2, 4*_proppitch - 2);
+        _j0 = _baseJ0 * Math::pow(2, 2 - 4*_proppitch);
     
     float tipspd = _r*omega;
     float V2 = v*v + tipspd*tipspd;