Jump to content

How do I find the highest terrain point on a celestrial body?


Recommended Posts

I'm trying to programically determine the 'low orbit' of a body, which is 10km above the highest surface peak or above it's atmosphere, which ever is greater.

but, I don't know how to [quickly] find the highest terrestrial point. anyone know?

Edited by Xyphos
Link to comment
Share on other sites

That shou

14 minutes ago, Xyphos said:

nevermind, I've decided to simply add 20Km from sea-level radius, as nothing (I know of) will even reach that high, and only 10Km for bodies with atmospheres.

That should work for stock and similarly sized planet packs but may not cover every eventuality (especially in real scale systems - highest "mountains" in the real life solar system are 22km on Vesta and 20km on Iapetus don't know if these are reflected in RSS).

Haven't tested in game but did you look at CelestialBody.getBounds().max ?

Edited by Aelfhe1m
Link to comment
Share on other sites

13 minutes ago, HebaruSan said:

I used CelestialBody.atmosphereDepth or CelestialBody.minOrbitalDistance, depending on whether there's an atmosphere:

 

Ah, that should work, thanks! 

 

6 minutes ago, Aelfhe1m said:

That shou

That should work for stock and similarly sized planet packs but may not cover every eventuality (especially in real scale systems - highest "mountains" in the real life solar system are 22km on Vesta and 20km on Iapetus don't know if these are reflected in RSS).

Haven't tested in game but did you look at CelestialBody.getBounds().max ?

good point, and IDK about getBounds.

Link to comment
Share on other sites

17 minutes ago, HebaruSan said:

I used CelestialBody.atmosphereDepth or CelestialBody.minOrbitalDistance, depending on whether there's an atmosphere:

 

Out of curiosity, any idea what that gives for Gilly? I ask because the science low space threshold is lower than the highest elevation making getting low orbital science something you need to be careful about (or only do while also landing).

Link to comment
Share on other sites

14 minutes ago, Aelfhe1m said:

Out of curiosity, any idea what that gives for Gilly?

 

snippet from my code:

{
                const double addedAltitude = 10000;

                Name = body.bodyName;
                GeeASL = body.GeeASL * G;
                Selected = body.isHomeWorld;// Name.Equals("Kerbin");

                var R = body.Radius + (body.atmosphere ? body.atmosphereDepth : body.minOrbitalDistance) + addedAltitude;
                var C = Math.PI * (R * R);
                Log("R: {0}", R);
           }

 

and the output from my debug log:

Gilly     G=0.0490667567239553
R: 680000

 

Link to comment
Share on other sites

The FinePrint.Utilities.CelestialUtilities class has a method for this: GetHighestPeak(CelesitalBody body).

It should give you what you need, though it doesn't tell you anything about the atmosphere, that would have to be considered separately.

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...