KSP API
Public Member Functions | Public Attributes | Properties | List of all members
CelestialBody Class Reference

The Sun, the planets, and the moons are all CelestialBodies. More...

Inheritance diagram for CelestialBody:
ITargetable IDiscoverable

Public Member Functions

 CelestialBody ()
 
void CBUpdate ()
 
void debugTimeWarpLimits ()
 
void DisplaySurfaceResource (int resourceID)
 
double GetAltitude (Vector3d worldPos)
 Gets the height of a given position above this body's sea level, in meters. More...
 
Bounds getBounds ()
 
double GetDensity (double pressure, double temperature)
 
Vector3d GetFrameVel ()
 The velocity of the CelestialBody, {AliceWorld, Sun}. (See Orbit.cs for the reference frame definitions). More...
 
Vector3d GetFrameVelAtUT (double UT)
 
Vector3 GetFwdVector ()
 
double GetLatitude (Vector3d worldPos)
 Gets the latitude of a given position, in degrees. More...
 
double GetLongitude (Vector3d worldPos)
 Gets the longitude of a given position, in degrees. Note that you CANNOT count on this value being in any particular range. This function may for example return 420, meaning 60 degrees east. You would be well advised to coerce it into a standard range like -180 to 180 before using it. More...
 
string GetName ()
 The name of this target. More...
 
Vector3 GetObtVelocity ()
 
Orbit GetOrbit ()
 
OrbitDriver GetOrbitDriver ()
 
Vector3d getPositionAtUT (double UT)
 
double GetPressure (double altitude)
 
Vector3d GetRelSurfaceNVector (double lat, double lon)
 
Vector3d GetRelSurfacePosition (Vector3d worldPosition)
 
Vector3d GetRelSurfacePosition (double lat, double lon, double alt)
 Returns a vector pointing from the center of the body to the given latitude, longitude, and altitude. More...
 
Vector3d getRFrmVel (Vector3d worldPos)
 Returns the velocity at a given position of the frame of reference that rotates with the planet. This velocity is the difference between the "orbit" and "surface" velocities. More...
 
double GetSolarPowerFactor (double density)
 
double GetSpeedOfSound (double pressure, double density)
 
Vector3 GetSrfVelocity ()
 
Vector3d GetSurfaceNVector (double lat, double lon)
 Returns a unit vector perpendicular to the surface of the body at the given latitude and longitude (pretending for the moment that the body is a perfect sphere). More...
 
VesselTargetModes GetTargetingMode ()
 
double GetTemperature (double altitude)
 
Transform GetTransform ()
 
Vector3d getTruePositionAtUT (double UT)
 
Vessel GetVessel ()
 
Vector3d GetWorldSurfacePosition (double lat, double lon, double alt)
 Returns the position, in world coordinates, of a given latitude, longitude, and altitude More...
 
bool HasChild (CelestialBody body)
 
bool HasParent (CelestialBody body)
 
void HideSurfaceResource ()
 
void resetTimeWarpLimits ()
 
double RevealAltitude ()
 Returns the body's altitude above the reference sphere of its primary More...
 
float RevealMass ()
 Returns the body's mass, in kg More...
 
string RevealName ()
 Returns the body's tracking station name More...
 
string RevealSituationString ()
 Describes the state of the body More...
 
double RevealSpeed ()
 Returns the body's speed More...
 
string RevealType ()
 Returns the type of the body More...
 
void SetResourceMap (Texture2D map)
 
void SetupConstants ()
 

Public Attributes

AtmosphereFromGround afg
 
double albedo
 
double angularV
 The magnitude of the angular velocity of the body's rotation, in radians per second. More...
 
Vector3d angularVelocity
 The body's angular velocity vector, in rotations per second. This points along the axis of rotation and its magnitude is the rotation rate in radians per second. More...
 
double atmDensityASL
 
bool atmosphere
 Whether this body has an atmosphere More...
 
double atmosphereAdiabaticIndex
 
bool atmosphereContainsOxygen
 Presumably, whether jet engines will work in this body's atmosphere More...
 
double atmosphereDepth
 
double atmosphereGasMassLapseRate
 
double atmosphereMolarMass
 
FloatCurve atmospherePressureCurve
 
bool atmospherePressureCurveIsNormalized
 
double atmospherePressureSeaLevel
 
FloatCurve atmosphereTemperatureCurve
 
bool atmosphereTemperatureCurveIsNormalized
 
double atmosphereTemperatureLapseRate
 
double atmosphereTemperatureSeaLevel
 
FloatCurve atmosphereTemperatureSunMultCurve
 
bool atmosphereUsePressureCurve
 
bool atmosphereUseTemperatureCurve
 
Color atmosphericAmbientColor
 
FloatCurve axialTemperatureSunMultCurve
 
CBAttributeMapSO BiomeMap
 
string bodyDescription
 
string bodyName
 The name of the body, as a string. More...
 
Transform bodyTransform
 
CelestialBodyType bodyType
 
double convectionMultiplier
 
double coreTemperatureOffset
 
double Density
 
double directRotAngle
 
FloatCurve eccentricityTemperatureSunMultCurve
 
double emissivity
 
double GeeASL
 The gravitational acceleration of the body at sea level, in units of gees (1 gee = 9.81 m/s^2) More...
 
double gMagnitudeAtCenter
 The gravitational acceleration (in m/s^2) at a radius r (in m) from the body's center is gMagnitudeAtCenter / r^2 More...
 
double gravParameter
 The gravitational parameter GM is the universal gravitational constant G times the mass M of the body. In KSP the gravitational constant G is exactly 6.673 m^3 / (kg s^2), and the body mass is measured in kilograms. More...
 
double hillSphere
 Unused? More...
 
double initialRotation
 
bool inverseRotation
 
float inverseRotThresholdAltitude
 
bool isHomeWorld
 
FloatCurve latitudeTemperatureBiasCurve
 
FloatCurve latitudeTemperatureSunMultCurve
 
double Mass
 The mass of the body in kilograms. Computed More...
 
double navballSwitchRadiusMult
 
bool ocean
 Whether this planet has an ocean at "sea level" More...
 
float oceanAFGAltMult
 
float oceanAFGBase
 
bool oceanAFGLerp
 
float oceanAFGMin
 
double oceanDensity
 
float oceanFogColorAltMult
 
Color oceanFogColorEnd
 
Color oceanFogColorStart
 
float oceanFogDensityAltScalar
 
float oceanFogDensityEnd
 
float oceanFogDensityExponent
 
float oceanFogDensityPQSMult
 
float oceanFogDensityStart
 
float oceanSkyColorMult
 
float oceanSkyColorOpacityAltMult
 
float oceanSkyColorOpacityBase
 
float oceanSunAltMult
 
float oceanSunBase
 
float oceanSunMin
 
bool oceanUseFog
 
OrbitDriver orbitDriver
 
List< CelestialBodyorbitingBodies
 A list of this body's moons (or, in the case of the Sun, a list of the planets). More...
 
PQS pqsController
 The pqsController computes the terrain of the planet. Note that for the Sun, pqsController = null. More...
 
CelestialBodySubtree progressTree
 
double Radius
 The radius of the planet in meters. Note that this is only the radius of "sea level"; the actual terrain may be higher. More...
 
double radiusAtmoFactor
 
bool rotates
 
QuaternionD rotation
 
double rotationAngle
 
double rotationPeriod
 The time, in seconds, for the body to complete one rotation around its axis More...
 
GameObject scaledBody
 
CelestialBodyScienceParams scienceValues
 
double shockTemperatureMultiplier
 
double solarDayLength
 
bool solarRotationPeriod
 
double sphereOfInfluence
 The radius of this body's sphere of influence (measured from the center of the body), in meters. More...
 
double SurfaceArea
 
bool tidallyLocked
 Presumably, whether this body is tidally locked to the body around with it orbits. More...
 
float[] timeWarpAltitudeLimits
 Presumably, this gives the minimum altitude you must have in order to be allowed to use each warp rate when in this body's sphere of influence. More...
 
bool use_The_InName
 
Vector3d zUpAngularVelocity
 

Properties

DiscoveryInfo DiscoveryInfo [get]
 Describes to what extent this body has been explored More...
 
int flightGlobalsIndex [get, set]
 
string name [get]
 
Orbit orbit [get]
 Describes the orbit of this body around its primary. More...
 
Vector3d position [get, set]
 The position of the center of the body, in world coordinates. More...
 
CelestialBody referenceBody [get]
 Presumably, the body this body orbits around More...
 
Texture2D ResourceMap [get]
 
PResource Resources [get]
 
Vector3d RotationAxis [get]
 
string theName [get]
 
- Properties inherited from IDiscoverable
DiscoveryInfo DiscoveryInfo [get]
 Describes to what extent this object has been explored More...
 

Detailed Description

The Sun, the planets, and the moons are all CelestialBodies.

Constructor & Destructor Documentation

CelestialBody.CelestialBody ( )

Member Function Documentation

void CelestialBody.CBUpdate ( )
void CelestialBody.debugTimeWarpLimits ( )
void CelestialBody.DisplaySurfaceResource ( int  resourceID)
double CelestialBody.GetAltitude ( Vector3d  worldPos)

Gets the height of a given position above this body's sea level, in meters.

Parameters
worldPosA position in world coordinates
Returns
Altitude in meters
Bounds CelestialBody.getBounds ( )
double CelestialBody.GetDensity ( double  pressure,
double  temperature 
)
Vector3d CelestialBody.GetFrameVel ( )

The velocity of the CelestialBody, {AliceWorld, Sun}. (See Orbit.cs for the reference frame definitions).

Vector3d CelestialBody.GetFrameVelAtUT ( double  UT)
Vector3 CelestialBody.GetFwdVector ( )

Implements ITargetable.

double CelestialBody.GetLatitude ( Vector3d  worldPos)

Gets the latitude of a given position, in degrees.

Parameters
worldPosA position in world coordinates
Returns
Latitude in degrees
double CelestialBody.GetLongitude ( Vector3d  worldPos)

Gets the longitude of a given position, in degrees. Note that you CANNOT count on this value being in any particular range. This function may for example return 420, meaning 60 degrees east. You would be well advised to coerce it into a standard range like -180 to 180 before using it.

Parameters
worldPosA position in world coordinates
Returns
Longitude in degrees
string CelestialBody.GetName ( )

The name of this target.

Implements ITargetable.

Vector3 CelestialBody.GetObtVelocity ( )

Implements ITargetable.

Orbit CelestialBody.GetOrbit ( )

Implements ITargetable.

OrbitDriver CelestialBody.GetOrbitDriver ( )

Implements ITargetable.

Vector3d CelestialBody.getPositionAtUT ( double  UT)
double CelestialBody.GetPressure ( double  altitude)
Vector3d CelestialBody.GetRelSurfaceNVector ( double  lat,
double  lon 
)
Vector3d CelestialBody.GetRelSurfacePosition ( Vector3d  worldPosition)
Vector3d CelestialBody.GetRelSurfacePosition ( double  lat,
double  lon,
double  alt 
)

Returns a vector pointing from the center of the body to the given latitude, longitude, and altitude.

Parameters
latLatitude in degrees
lonLongitude in degrees
altAltitude above sea level in meters
Returns
A position vector relative to the center of the body
Vector3d CelestialBody.getRFrmVel ( Vector3d  worldPos)

Returns the velocity at a given position of the frame of reference that rotates with the planet. This velocity is the difference between the "orbit" and "surface" velocities.

Parameters
worldPosA position in world coordinates
Returns
Velocity of the rotating reference frame
double CelestialBody.GetSolarPowerFactor ( double  density)
double CelestialBody.GetSpeedOfSound ( double  pressure,
double  density 
)
Vector3 CelestialBody.GetSrfVelocity ( )

Implements ITargetable.

Vector3d CelestialBody.GetSurfaceNVector ( double  lat,
double  lon 
)

Returns a unit vector perpendicular to the surface of the body at the given latitude and longitude (pretending for the moment that the body is a perfect sphere).

Parameters
latLatitude in degrees
lonLongitude in degrees
Returns
A unit normal vector to the surface
VesselTargetModes CelestialBody.GetTargetingMode ( )

Implements ITargetable.

double CelestialBody.GetTemperature ( double  altitude)
Transform CelestialBody.GetTransform ( )

Implements ITargetable.

Vector3d CelestialBody.getTruePositionAtUT ( double  UT)
Vessel CelestialBody.GetVessel ( )

Implements ITargetable.

Vector3d CelestialBody.GetWorldSurfacePosition ( double  lat,
double  lon,
double  alt 
)

Returns the position, in world coordinates, of a given latitude, longitude, and altitude

Parameters
latLatitude in degrees
lonLongitude in degrees
altAltitude above sea level in meters
Returns
Position in world coordinates
bool CelestialBody.HasChild ( CelestialBody  body)
bool CelestialBody.HasParent ( CelestialBody  body)
void CelestialBody.HideSurfaceResource ( )
void CelestialBody.resetTimeWarpLimits ( )
double CelestialBody.RevealAltitude ( )

Returns the body's altitude above the reference sphere of its primary

Implements IDiscoverable

Implements IDiscoverable.

float CelestialBody.RevealMass ( )

Returns the body's mass, in kg

Implements IDiscoverable

Implements IDiscoverable.

string CelestialBody.RevealName ( )

Returns the body's tracking station name

Implements IDiscoverable

Implements IDiscoverable.

string CelestialBody.RevealSituationString ( )

Describes the state of the body

Returns
A string containing the sphere of influence and trajectory of the object

"Orbiting the Sun"

Implements IDiscoverable

Implements IDiscoverable.

double CelestialBody.RevealSpeed ( )

Returns the body's speed

Implements IDiscoverable

Implements IDiscoverable.

string CelestialBody.RevealType ( )

Returns the type of the body

Returns
One of "Sun", "Planet", or "Moon"

Implements IDiscoverable

Implements IDiscoverable.

void CelestialBody.SetResourceMap ( Texture2D  map)
void CelestialBody.SetupConstants ( )

Member Data Documentation

AtmosphereFromGround CelestialBody.afg
double CelestialBody.albedo
double CelestialBody.angularV

The magnitude of the angular velocity of the body's rotation, in radians per second.

Vector3d CelestialBody.angularVelocity

The body's angular velocity vector, in rotations per second. This points along the axis of rotation and its magnitude is the rotation rate in radians per second.

double CelestialBody.atmDensityASL
bool CelestialBody.atmosphere

Whether this body has an atmosphere

double CelestialBody.atmosphereAdiabaticIndex
bool CelestialBody.atmosphereContainsOxygen

Presumably, whether jet engines will work in this body's atmosphere

double CelestialBody.atmosphereDepth
double CelestialBody.atmosphereGasMassLapseRate
double CelestialBody.atmosphereMolarMass
FloatCurve CelestialBody.atmospherePressureCurve
bool CelestialBody.atmospherePressureCurveIsNormalized
double CelestialBody.atmospherePressureSeaLevel
FloatCurve CelestialBody.atmosphereTemperatureCurve
bool CelestialBody.atmosphereTemperatureCurveIsNormalized
double CelestialBody.atmosphereTemperatureLapseRate
double CelestialBody.atmosphereTemperatureSeaLevel
FloatCurve CelestialBody.atmosphereTemperatureSunMultCurve
bool CelestialBody.atmosphereUsePressureCurve
bool CelestialBody.atmosphereUseTemperatureCurve
Color CelestialBody.atmosphericAmbientColor
FloatCurve CelestialBody.axialTemperatureSunMultCurve
CBAttributeMapSO CelestialBody.BiomeMap
string CelestialBody.bodyDescription
string CelestialBody.bodyName

The name of the body, as a string.

Transform CelestialBody.bodyTransform
CelestialBodyType CelestialBody.bodyType
double CelestialBody.convectionMultiplier
double CelestialBody.coreTemperatureOffset
double CelestialBody.Density
double CelestialBody.directRotAngle
FloatCurve CelestialBody.eccentricityTemperatureSunMultCurve
double CelestialBody.emissivity
double CelestialBody.GeeASL

The gravitational acceleration of the body at sea level, in units of gees (1 gee = 9.81 m/s^2)

double CelestialBody.gMagnitudeAtCenter

The gravitational acceleration (in m/s^2) at a radius r (in m) from the body's center is gMagnitudeAtCenter / r^2

double CelestialBody.gravParameter

The gravitational parameter GM is the universal gravitational constant G times the mass M of the body. In KSP the gravitational constant G is exactly 6.673 m^3 / (kg s^2), and the body mass is measured in kilograms.

double CelestialBody.hillSphere

Unused?

double CelestialBody.initialRotation
bool CelestialBody.inverseRotation
float CelestialBody.inverseRotThresholdAltitude
bool CelestialBody.isHomeWorld
FloatCurve CelestialBody.latitudeTemperatureBiasCurve
FloatCurve CelestialBody.latitudeTemperatureSunMultCurve
double CelestialBody.Mass

The mass of the body in kilograms. Computed

double CelestialBody.navballSwitchRadiusMult
bool CelestialBody.ocean

Whether this planet has an ocean at "sea level"

float CelestialBody.oceanAFGAltMult

float CelestialBody.oceanAFGBase
bool CelestialBody.oceanAFGLerp
float CelestialBody.oceanAFGMin
double CelestialBody.oceanDensity
float CelestialBody.oceanFogColorAltMult
Color CelestialBody.oceanFogColorEnd
Color CelestialBody.oceanFogColorStart
float CelestialBody.oceanFogDensityAltScalar
float CelestialBody.oceanFogDensityEnd
float CelestialBody.oceanFogDensityExponent
float CelestialBody.oceanFogDensityPQSMult
float CelestialBody.oceanFogDensityStart
float CelestialBody.oceanSkyColorMult
float CelestialBody.oceanSkyColorOpacityAltMult
float CelestialBody.oceanSkyColorOpacityBase
float CelestialBody.oceanSunAltMult
float CelestialBody.oceanSunBase
float CelestialBody.oceanSunMin
bool CelestialBody.oceanUseFog
OrbitDriver CelestialBody.orbitDriver

this is what gives the celestial body its orbit and makes it go along the orbit as well

List<CelestialBody> CelestialBody.orbitingBodies

A list of this body's moons (or, in the case of the Sun, a list of the planets).

PQS CelestialBody.pqsController

The pqsController computes the terrain of the planet. Note that for the Sun, pqsController = null.

CelestialBodySubtree CelestialBody.progressTree
double CelestialBody.Radius

The radius of the planet in meters. Note that this is only the radius of "sea level"; the actual terrain may be higher.

double CelestialBody.radiusAtmoFactor
bool CelestialBody.rotates
QuaternionD CelestialBody.rotation
double CelestialBody.rotationAngle
double CelestialBody.rotationPeriod

The time, in seconds, for the body to complete one rotation around its axis

GameObject CelestialBody.scaledBody
CelestialBodyScienceParams CelestialBody.scienceValues
double CelestialBody.shockTemperatureMultiplier
double CelestialBody.solarDayLength
bool CelestialBody.solarRotationPeriod
double CelestialBody.sphereOfInfluence

The radius of this body's sphere of influence (measured from the center of the body), in meters.

double CelestialBody.SurfaceArea
bool CelestialBody.tidallyLocked

Presumably, whether this body is tidally locked to the body around with it orbits.

float [] CelestialBody.timeWarpAltitudeLimits

Presumably, this gives the minimum altitude you must have in order to be allowed to use each warp rate when in this body's sphere of influence.

bool CelestialBody.use_The_InName
Vector3d CelestialBody.zUpAngularVelocity

Property Documentation

DiscoveryInfo CelestialBody.DiscoveryInfo
get

Describes to what extent this body has been explored

int CelestialBody.flightGlobalsIndex
getset
string CelestialBody.name
get
Orbit CelestialBody.orbit
get

Describes the orbit of this body around its primary.

Vector3d CelestialBody.position
getset

The position of the center of the body, in world coordinates.

CelestialBody CelestialBody.referenceBody
get

Presumably, the body this body orbits around

Texture2D CelestialBody.ResourceMap
get
PResource CelestialBody.Resources
get
Vector3d CelestialBody.RotationAxis
get
string CelestialBody.theName
get

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