kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

Suggestion: Changing interface from Orbit.xxx(Vessel target) to Orbit.xxx(Orbit target)

haeena opened this issue ยท 1 comments

commented

Hi. I'm currently playing KSP with kRPC, that is just great!

My career mode save just reached out of atmosphere of Kerbin, and aiming Minmus for next mission.
Then, I found that some methods in Orbit class only takes Vessel as its argument, e.g. Orbit.TrueAnomalyAtAN(Vessel target).
That seems to work well for rendezvous of vessels, but not well for CelestialBody.

Wondering If we just change interface from Orbit.xxx(Vessel target) to Orbit.xxx(Orbit target), those method should work both for rendezvous of vehicles, moon/interplanetary transfer.

Existing client code need to be changed too, but only a few required.

For instnace, that code

ut_an = v.orbit.ut_at_true_anomaly(v.orbit.true_anomaly_an(t))

can be simply replaced with this code.

ut_an = v.orbit.ut_at_true_anomaly(v.orbit.true_anomaly_an(t.orbit))

If this is acceptable, here's PR for the change. #479

commented

The PR has been merged and will be a part of the next release. Thanks!