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)

NAME

String

BODY

Body

HASBODY

boolean

HASORBIT

boolean

HASOBT

boolean

OBT

Orbit

ORBIT

Orbit

UP

Direction

NORTH

Direction

PROGRADE

Direction

SRFPROGRADE

Direction

RETROGRADE

Direction

SRFRETROGRADE

Direction

POSITION

Vector

VELOCITY

OrbitableVelocity

DISTANCE

Scalar (m)

DIRECTION

Direction

LATITUDE

Scalar (deg)

LONGITUDE

Scalar (deg)

ALTITUDE

Scalar (m)

GEOPOSITION

GeoCoordinates

PATCHES

List of Orbits

APOAPSIS

Scalar (m) (Deprecated, use :OBT:APOAPSIS instead.)

PERIAPSIS

Scalar (m) (Deprecated, use :OBT:PERIAPSIS instead.)

Orbitable:NAME
Type

String

Access

Get only

Name of this vessel or body.

Orbitable:HASBODY
Type

Boolean

Access

Get only

True if this object has a body it orbits (false only when this object is the Sun, pretty much).

Orbitable:HASORBIT
Type

Boolean

Access

Get only

Alias for HASBODY.

Orbitable:HASOBT
Type

Boolean

Access

Get only

Alias for HASBODY.

Orbitable:BODY
Type

Body

Access

Get only

The Body that this object is orbiting. I.e. Mun:BODY returns Kerbin.

Orbitable:OBT
Type

Orbit

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:ORBIT
Type

Orbit

Access

Get only

This is an alias for OBT, as described above.

Orbitable:UP
Type

Direction

Access

Get only

pointing straight up away from the SOI body.

Orbitable:NORTH
Type

Direction

Access

Get only

pointing straight north on the SOI body, parallel to the surface of the SOI body.

Orbitable:PROGRADE
Type

Direction

Access

Get only

pointing in the direction of this object’s orbitable-frame velocity

Orbitable:SRFPROGRADE
Type

Direction

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

Direction

Access

Get only

pointing in the opposite of the direction of this object’s orbitable-frame velocity

Orbitable:SRFRETROGRADE
Type

Direction

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

Vector

Access

Get only

The position of this object in the SHIP-RAW reference frame

Orbitable:VELOCITY
Type

OrbitableVelocity

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

Orbitable:DIRECTION
Type

Direction

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

GeoCoordinates

Access

Get only

A combined structure of the latitude and longitude numbers.

Orbitable:PATCHES
Type

List of Orbit “patches”

Access

Get only

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. use SHIP:OBT:APOAPSIS instead of SHIP:APOAPSIS, or use MUN:OBT:APOAPSIS instead of MUN: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. use SHIP:OBT:PERIAPSIS instead of SHIP:PERIAPSIS). or use MUN:OBT:PERIAPSIS instead of MUN:PERIAPSIS, etc).