- _F0 = 2*_etaC*power/(rho*v*V2);
-
- float stallAngle = 0.25;
- _lambdaS = _r*(_J0/_r - stallAngle) / _J0;
-
- // Now compute a correction for zero forward speed to make the
- // takeoff performance correct.
- float torque0 = power0/omega0;
- float thrust, torque;
- _takeoffCoef = 1;
- calc(Atmosphere::getStdDensity(0), 0, omega0, &thrust, &torque);
- _takeoffCoef = torque/torque0;
+ _f0 = 2*_etaC*power/(rho*v*V2);
+
+ _matchTakeoff = false;
+ _manual = false;
+ _proppitch = 0;
+ _propfeather = 0;
+}
+
+void Propeller::setTakeoff(float omega0, float power0)
+{
+ // Takeoff thrust coefficient at lambda==0
+ _matchTakeoff = true;
+ float V2 = _r*omega0 * _r*omega0;
+ float gamma = _etaC * _beta / _j0;
+ float torque = power0 / omega0;
+ float density = Atmosphere::getStdDensity(0);
+ _tc0 = (torque * gamma) / (0.5f * density * V2 * _f0);
+}
+
+void Propeller::setStops(float fine_stop, float coarse_stop)
+{
+ _fine_stop = fine_stop;
+ _coarse_stop = coarse_stop;
+}
+
+void Propeller::modPitch(float mod)
+{
+ _j0 *= mod;
+ if(_j0 < _fine_stop*_baseJ0) _j0 = _fine_stop*_baseJ0;
+ if(_j0 > _coarse_stop*_baseJ0) _j0 = _coarse_stop*_baseJ0;
+}
+
+void Propeller::setManualPitch()
+{
+ _manual = true;
+}
+
+void Propeller::setPropPitch(float proppitch)
+{
+ // makes only positive range of axis effective.
+ _proppitch = Math::clamp(proppitch, 0, 1);
+}
+
+void Propeller::setPropFeather(int state)
+{
+ // 0 = normal, 1 = feathered
+ _propfeather = (state != 0);