From 95da644df950411192310489ccb514504ff5d65c Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Aug 2006 14:19:15 +0000 Subject: [PATCH] Melchior sent me a property dump of the YF-23 in the wacky superthrust state. The only really obvious problem was a giant negative engine RPM, which happened because of a lack of clamping in the engine code combined with the YF-23's ability to actually reach speeds near the engines _vMax value. It's not clear to me that this will fix the superthrust issue at high AoA's, but it's an obvious bug nonetheless. --- src/FDM/YASim/Jet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FDM/YASim/Jet.cpp b/src/FDM/YASim/Jet.cpp index afbb669cd..f80cac543 100644 --- a/src/FDM/YASim/Jet.cpp +++ b/src/FDM/YASim/Jet.cpp @@ -142,10 +142,10 @@ void Jet::integrate(float dt) const static float T0 = Atmosphere::getStdTemperature(0); const static float D0 = Atmosphere::getStdDensity(0); - float speed = -Math::dot3(_wind, _dir); + float spd = -Math::dot3(_wind, _dir); float statT, statP, statD; - Atmosphere::calcStaticAir(_pressure, _temp, _rho, speed, + Atmosphere::calcStaticAir(_pressure, _temp, _rho, spd, &statP, &statT, &statD); _pressureCorrect = statP/P0; _tempCorrect = Math::sqrt(statT/T0); @@ -157,7 +157,7 @@ void Jet::integrate(float dt) _throttle = 0; // Linearly taper maxThrust to zero at vMax - float vCorr = 1 - (speed/_vMax); + float vCorr = spd<0 ? 1 : (spd<_vMax ? 1-spd/_vMax : 0); float maxThrust = _maxThrust * vCorr * (statD/D0); float setThrust = maxThrust * _throttle; -- 2.39.5