Jump to content

Velocity at a given point


Recommended Posts

I’m totally new to making KSP mods. I know C# and I succeeded at modifying some existing mods, but I’m stuck trying to write a new one.

I want to add the orbital velocity value to the ‘Add maneuver / Warp here’ popup window. What should I inherit and override to do that?

Link to comment
Share on other sites

  • 2 weeks later...

I don't think you can ask KSP "what's this ship's velocity at x point in the future"; you'd have to do the math yourself.

Look at the current orbit and speed, then query how far ahead in the future the 'warp to' button is, and then calculate what the ship's velocity would be at that point based on the planet's gravity and your altitude.

I have no idea why this would be useful.

Link to comment
Share on other sites

With a minor modification you could ask KSP what your velocity at a future point is. So long as there are no SOI changes the process is simple. SOI changes make it only slightly harder. Just use energy. Eg = mgh and Ek = 1/2 mv^2. hover over a point on the orbit and it would give you altitude. From that and your current altitude and velocity the new velocity could be calculated. SOI changes require iteration at the point where the change occurs but is still doable.

Link to comment
Share on other sites

The Orbit class should already handle all of that, you just need to create a display. If the Orbit class doesn't provide the bit of information you want, just extend it and add the math.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...