Orbitable (Vessels and Bodies)¶
All objects that can move in orbit around other objects share some similar structure. To help keep things as consistent as possible, that similar structure is defined here. Everything you see here works for both Vessels
and Bodies
.
Note
SOI Body
Every where you see the term SOI Body in the descriptions below, it refers to the body at the center of the orbit of this object - the body in who’s sphere of influence this object is located. It is important to make the distinction that if this object is itself a Body, the SOI body is the body being orbited, not the body doing the orbiting. I.e. When talking about the Mun, the SOI body means “Kerbin”. When talking about Kerbin, the SOI body means “Sun”.
- structure Orbitable¶
These terms are all read-only.
Suffix
Type (units)
Scalar
(m)Scalar
(deg)Scalar
(deg)Scalar
(m)Scalar
(m) (Deprecated, use :OBT:APOAPSIS instead.)Scalar
(m) (Deprecated, use :OBT:PERIAPSIS instead.)
- Orbitable:HASBODY¶
- Type
- Access
Get only
True if this object has a body it orbits (false only when this object is the Sun, pretty much).
- Orbitable:BODY¶
- Type
- Access
Get only
The
Body
that this object is orbiting. I.e.Mun:BODY
returnsKerbin
.
- Orbitable:OBT¶
- Type
- Access
Get only
The current single orbit “patch” that this object is on (not the future orbits it might be expected to achieve after maneuver nodes or encounter transitions, but what the current orbit would be if nothing changed and no encounters perturbed the orbit.
- Orbitable:NORTH¶
- Type
- Access
Get only
pointing straight north on the SOI body, parallel to the surface of the SOI body.
- Orbitable:PROGRADE¶
- Type
- Access
Get only
pointing in the direction of this object’s orbitable-frame velocity
- Orbitable:SRFPROGRADE¶
- Type
- Access
Get only
pointing in the direction of this object’s surface-frame velocity. Note that if this Orbitable is itself a body, remember that this is relative to the surface of the SOI body, not this body.
- Orbitable:RETROGRADE¶
- Type
- Access
Get only
pointing in the opposite of the direction of this object’s orbitable-frame velocity
- Orbitable:SRFRETROGRADE¶
- Type
- Access
Get only
pointing in the opposite of the direction of this object’s surface-frame velocity. Note that this is relative to the surface of the SOI body.
- Orbitable:POSITION¶
- Type
- Access
Get only
The position of this object in the SHIP-RAW reference frame
- Orbitable:VELOCITY¶
- Type
- Access
Get only
The
orbitable velocity
of this object in the SHIP-RAW reference frame
- Orbitable:DISTANCE¶
- Type
Scalar
(m)- Access
Get only
The
Scalar
distance between this object and the center ofSHIP
.
- Orbitable:DIRECTION¶
- Type
- Access
Get only
pointing in the direction of this object from
SHIP
.
- Orbitable:LATITUDE¶
- Type
Scalar
(deg)- Access
Get only
The latitude in degrees of the spot on the surface of the SOI body directly under this object.
- Orbitable:LONGITUDE¶
- Type
Scalar
(deg)- Access
Get only
The longitude in degrees of the spot on the surface of the SOI body directly under this object. Longitude returned will always be normalized to be in the range [-180,180].
- Orbitable:ALTITUDE¶
- Type
Scalar
(m)- Access
Get only
The altitude in meters above the sea level surface of the SOI body (not the center of the SOI body. To get the true radius of the orbit for proper math calculations remember to add altitude to the SOI body’s radius.)
- Orbitable:GEOPOSITION¶
- Type
- Access
Get only
A combined structure of the latitude and longitude numbers.
- Orbitable:PATCHES¶
-
The list of all the orbit patches that this object will transition to, not taking into account maneuver nodes. The zero-th patch of the list is the current orbit.
- Orbitable:APOAPSIS¶
- Type
Scalar
(deg)- Access
Get only
Deprecated since version 0.15: This is only kept here for backward compatibility. in new scripts you write, use
OBT:APOAPSIS
. (i.e. useSHIP:OBT:APOAPSIS
instead ofSHIP:APOAPSIS
, or useMUN:OBT:APOAPSIS
instead ofMUN:APOAPSIS
, etc).
- Orbitable:PERIAPSIS¶
- Type
Scalar
(deg)- Access
Get only
Deprecated since version 0.15: This is only kept here for backward compatibility. in new scripts you write, use
OBT:PERIAPSIS
. (i.e. useSHIP:OBT:PERIAPSIS
instead ofSHIP:PERIAPSIS
). or useMUN:OBT:PERIAPSIS
instead ofMUN:PERIAPSIS
, etc).