Fix throttling, first attempt to fix gravity turn.
This commit is contained in:
@ -1,16 +1,17 @@
|
||||
// Functions for calculating navigational and guidance values.
|
||||
@lazyglobal off.
|
||||
|
||||
// Returns the throttle value you should use to achieve the
|
||||
// target TWR. If TWR can't be achieved, returns 1.0. (full throttle)
|
||||
function ThrottleToTWR {
|
||||
parameter twr is 1.5.
|
||||
parameter targetTWR is 1.5.
|
||||
|
||||
local m is SHIP:MASS.
|
||||
local g is 9.81.
|
||||
if HAS_GRAV_SENSOR = true {
|
||||
set g to SHIP:SENSORS:GRAV:MAG.
|
||||
}
|
||||
return min((twr*m*g)/SHIP:AVAILABLETHRUST, 1.0).
|
||||
return min((targetTWR*m*g)/SHIP:AVAILABLETHRUST, 1.0).
|
||||
}
|
||||
|
||||
// Calculates the ship's current TWR.
|
||||
|
Reference in New Issue
Block a user