Refactor some functions only used once.

This commit is contained in:
Anna Rose Wiggins 2021-08-10 18:17:05 -04:00
parent e03222bac2
commit 310a3fb372
2 changed files with 21 additions and 18 deletions

View file

@ -1,22 +1,5 @@
// functions for calculating steering values.
function GetPitch {
parameter v is SHIP:FACING:FOREVECTOR.
return 90 - vectorangle(SHIP:UP:FOREVECTOR, v).
}
function GetAscentVector {
parameter minPitch.
// face prograde, but hold a solid eastern heading and don't
// rotate the ship
local newHeading is lookdirup(SHIP:SRFPROGRADE:FOREVECTOR,
heading(90, 0, 270):TOPVECTOR).
if GetPitch(newHeading:FOREVECTOR) < minPitch {
set newHeading to heading(90, minPitch, 270).
}
return newHeading.
}
// Create a node that will circularize the orbit.
// 'where' can be one of:
// the special string "APO", for the next Apoapsis.