Boris-Barboris / AtmosphereAutopilot

Plugin for Kerbal Space Program
GNU General Public License v3.0
47 stars 16 forks source link

FPA Vertical Mode Improvements #37

Closed T2Fat2Fly closed 1 year ago

T2Fat2Fly commented 1 year ago

Hi Boris,

I've made several improvements to the FPA vertical mode.

Changes are:

  1. Improve code robustness near 90° FPA.
  2. Clamp FPA values to [-90.0, 90.0], handle conversions when FPA is close to +-90° and avoid infinities being put to the fields.
  3. Vertical mode hotkey should only allow changing between Altitude<=>V/S, Altitude<=>FPA, but not V/S<=>FPA
Boris-Barboris commented 1 year ago

Will have a look this weekend.

T2Fat2Fly commented 1 year ago

this if is redundant, you can just clampf

Additional space can be saved by rotating desired_direction to planet2vesNorm by using Vector3.RotateTowards instead of Math.Tan and fpa_angle_epsilon stuff.

renamed from desired_vertspeed to desired_vertsetpoint to better represent it's meaning

Done.

but I still suggest showing both v/s and fpa and getting rid of all the conversions, syncs and epsilons.

May I still be disagree with this. Both V/S and FPA describe the same thing - how fast the vessel should travel along the "vertical" axis. So I shall stick to the idea that they should share the same field, just like how the field is shared across the speed control modes.

Boris-Barboris commented 1 year ago

Cool, thanks!