diff --git a/lib/rocket.ks b/lib/rocket.ks index 75138d8..8d65b95 100644 --- a/lib/rocket.ks +++ b/lib/rocket.ks @@ -67,6 +67,24 @@ function extend_antennas { } +function align_with { + // + // Aligns the rocket with the given vector or node. + // + parameter direction. // Vector or Node + parameter tolerance is 0.5. + + local alignment_vector is direction. + if direction:istype("Node") { + lock alignment_vector to direction:burnvector. // locking allows steering to dynamically update when the node does + } + + SAS off. + lock STEERING to alignment_vector. + wait until vang(SHIP:facing:vector, alignment_vector) <= tolerance. +} + + function unlock_control { // // Ensure that the throttle is 0 and that the player is not locked out of control.