Thrift struct comments
Comments about some thrift struct fields. Not all structs and fields are listed here, only when it's necessary.
Notes:
- fields about length/distance are in meters
- fields about time are in seconds
- fields about temperature are in Kelvin
- fields about mass are in Kg
- fields about angles are in degrees
- COM is short for "center of mass"
struct Vessel {
5: double MET, // time elapsed since the mission starts
6: i32 stage, // current stage
7: string biome, // current biome the vessel is in
15: optional map<string, observor.VesselResource> totalResources, // the whole vessel's resources
16: optional map<string, observor.VesselResource> inUseResources, // the resources currently comsumed by parts
}
struct Orbit {
2: double apoapsis, // the distance from the body's COM to apoapsis
3: double periapsis, // the distance from the body's COM to periapsis
4: double apoapsisAltitude, // the distance from sea level of the body to apoapsis
5: double periapsisAltitude, // the distance from sea level of the body to periapsis
8: double radius, // current distance from the body's COM to the orbiting object's COM
9: double speed, // magnitude of velocity in world space
10: double period, // orbital period
13: double eccentricity, // https://en.wikipedia.org/wiki/Orbital_eccentricity
14: double inclination, // https://en.wikipedia.org/wiki/Orbital_inclination
15: double longitudeOfAscendingNode, // https://en.wikipedia.org/wiki/Longitude_of_the_ascending_node
16: double argumentOfPeriapsis, // https://en.wikipedia.org/wiki/Argument_of_periapsis
17: double meanAnomalyAtEpoch, // https://en.wikipedia.org/wiki/Mean_anomaly
18: double epoch, // https://en.wikipedia.org/wiki/Mean_anomaly
19: double meanAnomaly, // https://en.wikipedia.org/wiki/Mean_anomaly
20: double eccentricAnomaly, // https://en.wikipedia.org/wiki/Eccentric_anomaly
21: double trueAnomaly, // https://en.wikipedia.org/wiki/True_anomaly
22: double timeToSOIChange, // the time after which the vessel will shift to another body's sphere of influence
23: double orbitalSpeed, // magnitude of velocity which is relative to the body's COM
}
struct Part {
4: i32 stage, // (Part.inverseStage)the stage the part appears in the actual stage GUI
10: double maxTemperature, // the part will be detroyed if temperature is higher than maxTemperature
11: double maxSkinTemperature, // the part will be detroyed if skin temperature is higher than maxSkinTemperature
12: optional Resources resources, // resources contained in this part
}
struct CelestialBody{
4: double gravitationalParameter, // https://en.wikipedia.org/wiki/Standard_gravitational_parameter
5: double surfaceGravity, // sea level gravity
6: double rotationalPeriod, // sidereal rotation period
7: double rotationalSpeed, // sidereal rotational speed, in degrees per second
8: double rotationAngle, // current body rotation angle, in degrees
9: double initialRotation, // body rotation angle at UT 0, in degrees
17: double flyingHighAltitudeThreshold, // a vessel is considered to be flying "high" in atmosphere above this altitude
18: double spaceHighAltitudeThreshold, // a vessel is considered to be orbiting "high" in space above this altitude
}
struct TargetOrbitInfo {
1: double closestApproachTime, // UT at which the distance between this object and target object is the closest
2: double closestApproachDistance, // the distance at "closestApproachTime"
3: double trueAnomalyAtAN, // angle of true anomaly at ascending node, in degrees, between 0 and 180
4: double trueAnomalyAtDN, // angle of true anomaly at descending node, in degrees, between 0 and 180
5: double relativeInclination, // angle of inclination relative to target's orbit, in degrees
}
struct ManeuverNode {
3: Vector3d deltaVVector, // the planned deltaV vector, won't change
4: double deltaV, // the planned deltaV magnitude, won't change, in m/s
5: Vector3d remainingBurnVector, // the remaining deltaV vector, changes as the vessel is maneuvering
6: double remainingDeltaV, // the magnitude of remaining deltaV vector, changes as the vessel is maneuvering
}
struct AttitudeInfo { // all the fields are from world reference frame, not normalized except prograde, normal and radial
1: Vector3d position, // position in world space
2: Vector3d direction, // the direction to which the vessel is pointing to in world space
3: Vector3d velocity, // velocity in world space
4: Vector3d prograde, // prograde direction of orbit in world space
5: Vector3d normal, // normal direction of orbit in world space
6: Vector3d radial, // radial direction of orbit in world space
7: Vector3d up, // up direction in world space, equal to "direction"
8: Vector3d forward, // forward direction in world space
9: Vector3d right, // right direction in world space
10: KQuaternionD rotation, // rotation in world space
}
struct Wheel {
3: double radius, // wheel radius, in meters
6: double brakeForce, // brake force percentage
8: double manualFrictionControl, // only take effect when auto-friction-control is disabled
11: bool powered, // true if the wheel is powered by motors
15: double motorOutput, // current torque generated, in Newton meters.
16: bool tractionControlEnabled, // can be enabled only when the wheel is powered by motors
17: double tractionControl, // take effect if traction control is enabled
18: double driveLimiter, // take effect if traction control is disabled
27: double stress, // current stress on the wheel, in kPA
28: double stressTolerance, // stress above which the wheel will be broken, in kPA
29: double stressPercentage, // percentage of stress to tolerance
}
struct ConverterResource {
// for example, ratios of input resource A and B are 0.3 and 0.7,
// then for each 1 unit output resource (in total), 0.3 units of A and 0.7 units of B are consumed.
2: double ratio,
}
struct Propellant {
2: double currentAmount, // current flow speed, in Units per second
3: double currentRequirement, // current Maximum flow speed with current throttle, in Units per second
4: double totalResourceAvailable, // total resource amount reachable
5: double totalResourceCapacity, // total resource capacity reachable
6: bool isDeprived, // whether the object has ran out of given resource
}
struct Engine {
2: double thrust, // current thrust, in Newtons
3: double maxVacuumThrust, // amount of thrust in vacuum with thrustPercentage set to 100%, in Newtons
4: double thrustPercentage, // percentage to which the max thrust is limited
5: double specificImpulse, // current specific impulse, in seconds
6: double vacuumSpecificImpulse, // specific impulse in vacuum, in seconds
7: double kerbinSeaLevelSpecificImpulse, // specific impulse at sea level at Kerbin
9: map<string, Propellant> propellants, // propellants reachable and used by this engine
11: double throttle, // current throttle, may be different from vessel's mainThrottle if the engine takes time to change
15: bool hasModes, // true if this is a multi-mode engine
20: double gimbalRange, // in degrees
22: double gimbalLimit, // gimbal limit range, range from -100(reversed) to 100
}
struct Decoupler {
1: bool decoupled, // true if fired
2: bool stagingEnabled, // true if enabled in staging sequence
3: double ejectionForce, // impulse, in Newton seconds
}
struct ControlSurface {
4: double authorityLimiter, // the range it can move, in percentage
7: double surfaceArea, // in m^2
}
struct Antenna {
3: bool allowPartial, // true if partial data transmission is allowed
5: bool combinable, // true if can be conbined with other antennas to increase signal strengh
6: double combinableExponent, // the exponent used to calculate conbined power
7: double packetInterval, // in second.
8: double packetSize, // in Mits
9: double packetResourceCost, // how many units of electricity is comsumed per packet
}
struct Resource {
2: double capacity, // capacity amount of resource stored in this part
3: double amount, // current amount of resource stored in this part
}