From: <sv...@ww...> - 2004-12-18 11:40:03
|
Author: mkrose Date: 2004-12-18 03:39:57 -0800 (Sat, 18 Dec 2004) New Revision: 1410 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/Engine.cpp Log: Hack upon hack to prevent engine cutoff when stationary in a light tailwind (AOA near 180 deg). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1410 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-12-18 11:38:01 UTC (rev 1409) +++ trunk/CSP/CSPSim/CHANGES.current 2004-12-18 11:39:57 UTC (rev 1410) @@ -11,6 +11,9 @@ 3160. You still need to specify ServerIp to connect to remote index servers. + * Hack upon hack to prevent engine cutoff when stationary in a light + tailwind (AOA near 180 deg). + 2004-12-18: delta * Until we make a more accurate FCS, we'll use the animation binding to provide a better visual approximation of the animations of the "ailerons" Modified: trunk/CSP/CSPSim/Source/Engine.cpp =================================================================== --- trunk/CSP/CSPSim/Source/Engine.cpp 2004-12-18 11:38:01 UTC (rev 1409) +++ trunk/CSP/CSPSim/Source/Engine.cpp 2004-12-18 11:39:57 UTC (rev 1410) @@ -169,17 +169,20 @@ void EngineDynamics::cut() { double alpha = b_Alpha->value(); + // f is a totally ad-hoc means of preventing a slight tailwind from killing + // the engine when we aren't moving. + double f = simdata::clampTo(4.0 * (b_Mach->value() - 0.25), 0.0, 1.0); if ((std::abs(alpha) > simdata::PI_2) || (alpha < -m_A)) { - m_Force = simdata::Vector3::ZERO; + m_Force *= (1.0 - f); } else if (alpha < m_B) { - m_Force *= cos( flatten(alpha)); + m_Force *= (1.0 - f) + f * cos(flatten(alpha)); } else if (alpha < m_C) { - m_Force *= cos(m_B + (simdata::PI_2 - m_B)*(alpha - m_B)/(m_C-m_B)); + m_Force *= (1.0 - f) + f * cos(m_B + (simdata::PI_2 - m_B)*(alpha - m_B)/(m_C-m_B)); } else { - m_Force = simdata::Vector3::ZERO; + m_Force *= (1.0 - f); } } |