コード例 #1
0
        /// <summary>
        /// Allows the flightmodel to override the controls.
        /// </summary>
        /// <param name="elapsedTime"></param>
        public void UpdateControls(float elapsedTime)
        {
            if (ApiModel.UpdateControls(elapsedTime))
            {
                return;
            }
            double delay          = AircraftParameters.ThrottleDelay;
            double targetThrottle = (Throttle + 1.0) / 2.0;

            Throttle     = Math.Min((1 - delay * elapsedTime) * prevThrottle + elapsedTime * delay * targetThrottle, 1);
            prevThrottle = Math.Min(Throttle, 1.0);
        }