X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FYASim%2FPropeller.cpp;h=af19e705088467c79f54d15a7c72d3797f10562d;hb=d66903e9ad63b91182ccc25d9bb82f18f8dd98b6;hp=661a3842edff1c3d9fdef29a5ae9581295768009;hpb=2aaa1803d3d4d01ef6036561fb1338a0402751f2;p=flightgear.git diff --git a/src/FDM/YASim/Propeller.cpp b/src/FDM/YASim/Propeller.cpp index 661a3842e..af19e7050 100644 --- a/src/FDM/YASim/Propeller.cpp +++ b/src/FDM/YASim/Propeller.cpp @@ -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) @@ -36,12 +37,18 @@ void Propeller::setTakeoff(float omega0, float power0) 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 < 0.25f*_baseJ0) _j0 = 0.25f*_baseJ0; - if(_j0 > 4*_baseJ0) _j0 = 4*_baseJ0; + if(_j0 < _fine_stop*_baseJ0) _j0 = _fine_stop*_baseJ0; + if(_j0 > _coarse_stop*_baseJ0) _j0 = _coarse_stop*_baseJ0; } void Propeller::setManualPitch() @@ -55,12 +62,19 @@ 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) { // For manual pitch, exponentially modulate the J0 value between // 0.25 and 4. A prop pitch of 0.5 results in no change from the // base value. + // TODO: integrate with _fine_stop and _coarse_stop variables if (_manual) _j0 = _baseJ0 * Math::pow(2, 2 - 4*_proppitch);