Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
FinePrint.Utilities.CelestialUtilities Class Reference

Static Public Member Functions

static Vessel.Situations ApplicableSituation (int seed, CelestialBody body, bool splashAllowed)
 Chooses a random situation that a celestial body is capable of supporting. More...
 
static bool CanBodyBeKolniya (CelestialBody body)
 Determines whether this celestial body supports Molniya orbits. More...
 
static bool CanBodyBeSynchronous (CelestialBody body, double eccentricity)
 Determines whether this celestial body supports synchronous orbits. More...
 
static bool CanBodyBeTundra (CelestialBody body)
 Determines whether this celestial body supports tundra orbits. More...
 
static List< CelestialBodyChildrenOf (CelestialBody parentBody)
 Get the children for a specified celestial body. More...
 
static double GetAltitudeForDensity (CelestialBody body, double density)
 Gets the altitude on the body that has the specified density. Uses the default (not modified by latitude/sun/etc) temperature curve. Returns alt of 0 if requested density > that of the body at sea level. More...
 
static double GetHighestPeak (CelestialBody body)
 Estimates the altitude of the highest peak of a celestial body. Uses reflection, use sparingly. More...
 
static CelestialBody GetHostPlanet (CelestialBody body)
 Gets the planet the given body is orbiting, or the sun. More...
 
static double GetMinimumOrbitalDistance (CelestialBody body, float margin)
 Gets the minimum safe orbital distance from a celestial body. More...
 
static List< CelestialBodyGetNeighbors (CelestialBody body, Func< CelestialBody, bool > where=null)
 Chooses a random neighbor of a celestial body - a moon, or the reference body. More...
 
static double GetNextTimeWarp (CelestialBody body, double altitude)
 Gets the next time warp level above a certain altitude. More...
 
static List< CelestialBodyGetPlanetarySystem (CelestialBody body)
 Gets all the children of the parent planet of the given body. More...
 
static double GetSolarExtents ()
 Gets the extents of the solar system. More...
 
static double GreatCircleDistance (CelestialBody body, double latitude1, double longitude1, double latitude2, double longitude2)
 Calculates great circle distance between two points on a celestial body. More...
 
static double GreatCircleDistance (CelestialBody body, Vector3d position1, Vector3d position2)
 Calculates great circle distance between two points on a celestial body. More...
 
static CelestialBody HighestBody (List< CelestialBody > bodies)
 The celestial body with the highest scientific importance in a List. More...
 
static bool IsFlyablePlanet (CelestialBody body)
 Determines whether the specified celestial body is a flyable planet. More...
 
static bool IsGasGiant (CelestialBody body)
 Determines whether the specified celestial body is a gas giant. More...
 
static double KolniyaSMA (CelestialBody body)
 Calculates the semi major axis of a Molniya orbit. More...
 
static Vector3 LLAtoECEF (double lat, double lon, double alt, double radius)
 Converts "Longitude Latitude Altitude" to "Earth Centered Earth Fixed" coordinates. More...
 
static CelestialBody LowestBody (List< CelestialBody > bodies)
 The celestial body with the lowest scientific importance in a List. More...
 
static CelestialBody MapFocusBody (CelestialBody fallback=null)
 Gets the currently focused celestial body in the planetarium. More...
 
static float PlanetScienceRanking (CelestialBody body)
 A float the describes a celestial body's relative scientific importance. More...
 
static CelestialBody RandomBody (List< CelestialBody > bodies)
 Chooses a random celestial body from a List. More...
 
static double SynchronousSMA (CelestialBody body)
 Calculates the semi major axis of a synchronous orbit. More...
 
static double TerrainAltitude (CelestialBody body, double latitude, double longitude, bool underwater=false)
 Calculates terrain altitude at a specific position. More...
 

Member Function Documentation

static Vessel.Situations FinePrint.Utilities.CelestialUtilities.ApplicableSituation ( int  seed,
CelestialBody  body,
bool  splashAllowed 
)
inlinestatic

Chooses a random situation that a celestial body is capable of supporting.

Parameters
seedThe random seed.
bodyThe celestial body to check
splashAllowedIf splashdowns should be an options
Returns
Returns a vessel situation appropriate for the target celestial body.
static bool FinePrint.Utilities.CelestialUtilities.CanBodyBeKolniya ( CelestialBody  body)
inlinestatic

Determines whether this celestial body supports Molniya orbits.

Parameters
bodyThe celestial body.
Returns
If the apoapsis exceeds the sphere of influence.
static bool FinePrint.Utilities.CelestialUtilities.CanBodyBeSynchronous ( CelestialBody  body,
double  eccentricity 
)
inlinestatic

Determines whether this celestial body supports synchronous orbits.

Parameters
bodyThe celestial body.
eccentricityThe eccentricity of the synchronous orbit.
Returns
If the apoapsis exceeds the sphere of influence.
static bool FinePrint.Utilities.CelestialUtilities.CanBodyBeTundra ( CelestialBody  body)
inlinestatic

Determines whether this celestial body supports tundra orbits.

Parameters
bodyThe celestial body.
Returns
If the apoapsis exceeds the sphere of influence.
static List<CelestialBody> FinePrint.Utilities.CelestialUtilities.ChildrenOf ( CelestialBody  parentBody)
inlinestatic

Get the children for a specified celestial body.

Parameters
parentBodyThe parent celestial body.
Returns
Returns a list of celestial bodies orbiting the parent celestial body.
static double FinePrint.Utilities.CelestialUtilities.GetAltitudeForDensity ( CelestialBody  body,
double  density 
)
inlinestatic

Gets the altitude on the body that has the specified density. Uses the default (not modified by latitude/sun/etc) temperature curve. Returns alt of 0 if requested density > that of the body at sea level.

Parameters
body
density
Returns
static double FinePrint.Utilities.CelestialUtilities.GetHighestPeak ( CelestialBody  body)
inlinestatic

Estimates the altitude of the highest peak of a celestial body. Uses reflection, use sparingly.

Parameters
bodyThe celestial body.
Returns
The altitude of the highest peak.

< Add up the deformities and offsets of all PQSMods on the planet. Known not to work too well with Minmus, but better than nothing.

static CelestialBody FinePrint.Utilities.CelestialUtilities.GetHostPlanet ( CelestialBody  body)
inlinestatic

Gets the planet the given body is orbiting, or the sun.

Parameters
bodyThe given body.
Returns
The parent body.
static double FinePrint.Utilities.CelestialUtilities.GetMinimumOrbitalDistance ( CelestialBody  body,
float  margin 
)
inlinestatic

Gets the minimum safe orbital distance from a celestial body.

Parameters
bodyThe celestial body.
marginDistance multiplier.
Returns
A distance above atmosphere and terrain. Note that this is radial, not altitude.

< Calculate the actual atmospheric limits.

< Now calculate where the highest terrain is.

< Choose the next timewarp altitude limit just above that estimate. (There are planets with timewarp altitudes below their highest peak.)

static List<CelestialBody> FinePrint.Utilities.CelestialUtilities.GetNeighbors ( CelestialBody  body,
Func< CelestialBody, bool >  where = null 
)
inlinestatic

Chooses a random neighbor of a celestial body - a moon, or the reference body.

Parameters
bodyThe celestial body.
whereAn optional delegate further describing the desired neighbor.
Returns
A random neighbor.
static double FinePrint.Utilities.CelestialUtilities.GetNextTimeWarp ( CelestialBody  body,
double  altitude 
)
inlinestatic

Gets the next time warp level above a certain altitude.

Parameters
bodyThe celestial body.
altitudeThe altitude.
Returns
The time warp level above the altitude.
static List<CelestialBody> FinePrint.Utilities.CelestialUtilities.GetPlanetarySystem ( CelestialBody  body)
inlinestatic

Gets all the children of the parent planet of the given body.

Parameters
bodyThe given body.
Returns
All of its siblings.
static double FinePrint.Utilities.CelestialUtilities.GetSolarExtents ( )
inlinestatic

Gets the extents of the solar system.

Returns
The largest apoapsis in the system.
static double FinePrint.Utilities.CelestialUtilities.GreatCircleDistance ( CelestialBody  body,
double  latitude1,
double  longitude1,
double  latitude2,
double  longitude2 
)
inlinestatic

Calculates great circle distance between two points on a celestial body.

Parameters
bodyThe celestial body.
latitude1The first latitude.
longitude1The first longitude.
latitude2The second latitude.
longitude2The second longitude.
Returns
The distance between these two points.
static double FinePrint.Utilities.CelestialUtilities.GreatCircleDistance ( CelestialBody  body,
Vector3d  position1,
Vector3d  position2 
)
inlinestatic

Calculates great circle distance between two points on a celestial body.

Parameters
bodyThe celestial body.
position1The first world position.
position2The second world position.
Returns
The distance between these two points.
static CelestialBody FinePrint.Utilities.CelestialUtilities.HighestBody ( List< CelestialBody bodies)
inlinestatic

The celestial body with the highest scientific importance in a List.

Parameters
bodiesThe celestial bodies.
Returns
A celestial body.
static bool FinePrint.Utilities.CelestialUtilities.IsFlyablePlanet ( CelestialBody  body)
inlinestatic

Determines whether the specified celestial body is a flyable planet.

Parameters
bodyThe celestial body.
Returns
If the celestial body can be flown on.
static bool FinePrint.Utilities.CelestialUtilities.IsGasGiant ( CelestialBody  body)
inlinestatic

Determines whether the specified celestial body is a gas giant.

Parameters
bodyThe celestial body.
Returns
If the celestial body has a surface.
static double FinePrint.Utilities.CelestialUtilities.KolniyaSMA ( CelestialBody  body)
inlinestatic

Calculates the semi major axis of a Molniya orbit.

Parameters
bodyThe celestial body to orbit.
Returns
The semi major axis of the orbit.

< Kolniya orbits have periods of half a day.

static Vector3 FinePrint.Utilities.CelestialUtilities.LLAtoECEF ( double  lat,
double  lon,
double  alt,
double  radius 
)
inlinestatic

Converts "Longitude Latitude Altitude" to "Earth Centered Earth Fixed" coordinates.

Parameters
latThe latitude.
lonThe longitude.
altThe altitude.
radiusThe radius of the celestial body.
Returns
An ECEF cartesian coordinate.
static CelestialBody FinePrint.Utilities.CelestialUtilities.LowestBody ( List< CelestialBody bodies)
inlinestatic

The celestial body with the lowest scientific importance in a List.

Parameters
bodiesThe celestial bodies.
Returns
A celestial body.
static CelestialBody FinePrint.Utilities.CelestialUtilities.MapFocusBody ( CelestialBody  fallback = null)
inlinestatic

Gets the currently focused celestial body in the planetarium.

Returns
The celestial body of the camera.
static float FinePrint.Utilities.CelestialUtilities.PlanetScienceRanking ( CelestialBody  body)
inlinestatic

A float the describes a celestial body's relative scientific importance.

Parameters
bodyThe celestial body.
Returns
A float from 0-1.
static CelestialBody FinePrint.Utilities.CelestialUtilities.RandomBody ( List< CelestialBody bodies)
inlinestatic

Chooses a random celestial body from a List.

Parameters
bodiesThe celestial bodies.
Returns
A celestial body.
static double FinePrint.Utilities.CelestialUtilities.SynchronousSMA ( CelestialBody  body)
inlinestatic

Calculates the semi major axis of a synchronous orbit.

Parameters
bodyThe celestial body to orbit.
Returns
The semi major axis of the orbit.
static double FinePrint.Utilities.CelestialUtilities.TerrainAltitude ( CelestialBody  body,
double  latitude,
double  longitude,
bool  underwater = false 
)
inlinestatic

Calculates terrain altitude at a specific position.

Parameters
bodyThe celestial body.
latitudeThe latitude.
longitudeThe longitude.
Returns
The altitude of the terrain.

The documentation for this class was generated from the following file: