Advertisement
sumguytwitches

rcs to ground

Nov 11th, 2021 (edited)
1,162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // !runscript RM6SSKbR
  2. set tp to ship:geoposition.
  3. lock offset to v(0,0,0).
  4. lock approach to up:vector.
  5.  
  6. set sep to 1.
  7. set sl to 0.
  8.  
  9. lock steering to up.
  10.  
  11. when true then {
  12.     set rel_v to ship:velocity:surface.
  13.     set wv_pos to (tp:position + offset + approach * sep).
  14.     set wanted_v to wv_pos:normalized * min(sl , (wv_pos:mag * 0.25)^0.55).
  15.     set ve to wanted_v - rel_v.
  16.  
  17.     set ship:control:translation to v(
  18.     -vdot(facing:starvector,ve),
  19.     -vdot(facing:topvector,ve),
  20.     -vdot(facing:vector,ve)
  21.   ).
  22.  
  23.     return true.
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement