Engine working
This commit is contained in:
@@ -40,9 +40,7 @@ public class Program
|
||||
// Throttle control
|
||||
private static double _throttleTarget = 1.0; // 0‑1, set by arrow keys
|
||||
private static double _throttleCurrent = 0.0; // actual current fraction (lerped)
|
||||
private const double ThrottleLerpRate = 5.0; // times per second (speed of movement)
|
||||
private const double ThrottleMinArea = 0.0000000000001; // 3.7e-5 m² ≈ 0.37 cm² (10% of pipe)
|
||||
private const double ThrottleMaxArea = 0.00000000001; // 3.7 cm² (full open)
|
||||
private const double ThrottleLerpRate = 10.0; // times per second (speed of movement)
|
||||
private static bool _wKeyHeld = false;
|
||||
private static double _lastThrottleUpdateTime;
|
||||
|
||||
@@ -94,8 +92,7 @@ public class Program
|
||||
_throttleCurrent += (throttleDesiredFraction - _throttleCurrent) * smoothing;
|
||||
}
|
||||
|
||||
double actualArea = ThrottleMinArea + (ThrottleMaxArea - ThrottleMinArea) * _throttleCurrent;
|
||||
_scenario.ThrottleArea = actualArea;
|
||||
_scenario.Throttle = _throttleCurrent;
|
||||
|
||||
// ---- Drawing ----
|
||||
if (now - lastDrawTime >= 1.0 / DrawFrequency)
|
||||
|
||||
Reference in New Issue
Block a user