.. default-domain:: c .. highlight:: c .. _cnano-api-editor: Editor ====== .. type:: krpc_SpaceCenter_Editor_t Provides access to the vehicle assembly building and space plane hangar. Obtained by calling :func:`krpc_SpaceCenter_Editor`. .. function:: krpc_error_t krpc_SpaceCenter_Editor_Facility(krpc_connection_t connection, krpc_SpaceCenter_EditorFacility_t * returnValue, krpc_SpaceCenter_Editor_t instance) The editor that is currently open. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_Editor_Vessel(krpc_connection_t connection, krpc_SpaceCenter_EditorVessel_t * returnValue, krpc_SpaceCenter_Editor_t instance) The vessel that is being constructed. :Game Scenes: Editor Vab, Editor Sph .. note:: An editor that has not had a vessel loaded into it holds an empty vessel, with no parts, rather than nothing at all. .. function:: krpc_error_t krpc_SpaceCenter_Editor_LoadVessel(krpc_connection_t connection, krpc_SpaceCenter_Editor_t instance, const char * craftDirectory, const char * name) Load a vessel from a craft file into the editor, replacing the vessel that is currently being constructed. :Parameters: * **craftDirectory** -- Name of the directory in the current saves "Ships" directory, that contains the craft file. For example ``"VAB"`` or ``"SPH"``. * **name** -- Name of the vessel to load. This is the name of the ".craft" file in the save directory, without the ".craft" file extension. :Game Scenes: Editor Vab, Editor Sph .. note:: The vessel is loaded into whichever editor is open, regardless of which directory it came from. Its delta-v figures are recalculated in the background afterwards; see :func:`krpc_SpaceCenter_EditorVessel_DeltaVReady`. .. function:: krpc_error_t krpc_SpaceCenter_Editor_LaunchVessel(krpc_connection_t connection, krpc_SpaceCenter_Editor_t instance, const char * launchSite, const krpc_list_string_t * crew, bool recover, const char * flagUrl) Launch the vessel that is being constructed, from the given launch site. :Parameters: * **launchSite** -- Name of the launch site. For example ``"LaunchPad"`` or ``"Runway"``. * **crew** -- The Kerbals to place in the vessel, by name. Controls how the vessel is crewed, as described in the remarks. * **recover** -- If true and there is a vessel on the launch site, recover it before launching. * **flagUrl** -- If not ``nullptr``, the asset URL of the mission flag to use for the launch. :Game Scenes: Editor Vab, Editor Sph .. note:: The vessel being constructed is not a craft file, so it is written to the editor's auto-saved craft file and that is launched, as the game's own launch button does. The vessel's own craft file, if it was loaded from one, is left alone. The *crew* parameter works as it does for :func:`krpc_SpaceCenter_LaunchVessel`, and takes precedence over the crew assigned in the editor. Throws an exception if any of the games pre-flight checks fail. .. function:: krpc_error_t krpc_SpaceCenter_Editor_DeltaVBody(krpc_connection_t connection, krpc_SpaceCenter_CelestialBody_t * returnValue, krpc_SpaceCenter_Editor_t instance) .. function:: krpc_error_t krpc_SpaceCenter_Editor_set_DeltaVBody(krpc_connection_t connection, krpc_SpaceCenter_Editor_t instance, krpc_SpaceCenter_CelestialBody_t value) The body whose gravity and atmosphere the vessel's delta-v, thrust, TWR and specific impulse figures assume. :Game Scenes: Editor Vab, Editor Sph .. note:: This and :func:`krpc_SpaceCenter_Editor_DeltaVAltitude` are what :func:`krpc_SpaceCenter_EditorVessel_DeltaV`, :func:`krpc_SpaceCenter_Stage_DeltaV` and the other current-situation figures are computed for. The body sets the gravity the thrust-to-weight ratios are against, and, with the altitude, the atmospheric pressure and density the specific impulses and thrusts are against. This is global game state rather than editor state: the same setting backs the game's delta-v readout in flight, and it persists across scene changes. Setting it asks the game to re-run the simulation and returns straight away; the figures are out of date until :func:`krpc_SpaceCenter_EditorVessel_DeltaVReady` is true again. .. function:: krpc_error_t krpc_SpaceCenter_Editor_DeltaVAltitude(krpc_connection_t connection, double * returnValue, krpc_SpaceCenter_Editor_t instance) .. function:: krpc_error_t krpc_SpaceCenter_Editor_set_DeltaVAltitude(krpc_connection_t connection, krpc_SpaceCenter_Editor_t instance, double value) The altitude above :func:`krpc_SpaceCenter_Editor_DeltaVBody`, in meters, that the vessel's delta-v, thrust, TWR and specific impulse figures assume. The atmospheric pressure and density at this altitude are what the figures are computed for, so raising it from zero to above the body's atmosphere moves them from the vessel's sea-level figures to its vacuum ones. Setting it asks the game to re-run the simulation and returns straight away; the figures are out of date until :func:`krpc_SpaceCenter_EditorVessel_DeltaVReady` is true again. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_Editor_DeltaVSituation(krpc_connection_t connection, krpc_SpaceCenter_DeltaVSituation_t * returnValue, krpc_SpaceCenter_Editor_t instance) .. function:: krpc_error_t krpc_SpaceCenter_Editor_set_DeltaVSituation(krpc_connection_t connection, krpc_SpaceCenter_Editor_t instance, krpc_SpaceCenter_DeltaVSituation_t value) Which situation the game's own delta-v readout shows figures for. :Game Scenes: Editor Vab, Editor Sph .. note:: This selects which column the game's own delta-v app displays, and nothing else. It does not affect anything kRPC reports: the current-situation figures follow :func:`krpc_SpaceCenter_Editor_DeltaVBody` and :func:`krpc_SpaceCenter_Editor_DeltaVAltitude` whatever this is set to, and the sea-level and vacuum figures are reported directly as :func:`krpc_SpaceCenter_EditorVessel_SeaLevelDeltaV` and :func:`krpc_SpaceCenter_EditorVessel_VacuumDeltaV`. It is here for completeness with the app. .. type:: krpc_SpaceCenter_DeltaVSituation_t The situation the game's own delta-v readout shows figures for. See :func:`krpc_SpaceCenter_Editor_DeltaVSituation`. .. macro:: KRPC_SPACECENTER_DELTAVSITUATION_SEALEVEL At sea level on the selected body. .. macro:: KRPC_SPACECENTER_DELTAVSITUATION_ALTITUDE At the selected altitude on the selected body. .. macro:: KRPC_SPACECENTER_DELTAVSITUATION_VACUUM In vacuum. .. type:: krpc_SpaceCenter_EditorVessel_t The vessel that is being constructed in the editor. Obtained by calling :func:`krpc_SpaceCenter_Editor_Vessel`. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Name(krpc_connection_t connection, char * * returnValue, krpc_SpaceCenter_EditorVessel_t instance) .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_set_Name(krpc_connection_t connection, krpc_SpaceCenter_EditorVessel_t instance, const char * value) The name of the vessel. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Description(krpc_connection_t connection, char * * returnValue, krpc_SpaceCenter_EditorVessel_t instance) .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_set_Description(krpc_connection_t connection, krpc_SpaceCenter_EditorVessel_t instance, const char * value) The description of the vessel. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Facility(krpc_connection_t connection, krpc_SpaceCenter_EditorFacility_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The editor the vessel is in. :Game Scenes: Editor Vab, Editor Sph .. note:: This is the editor the vessel is currently loaded into, not the one it was designed in. A vessel moved from the vehicle assembly building to the space plane hangar reports the space plane hangar. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Mass(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The total mass of the vessel, including resources and crew, in kg. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_DryMass(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The total mass of the vessel, excluding resources, in kg. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_MomentOfInertia(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The moment of inertia of the vessel around its center of mass in :math:`kg.m^2`. The inertia values in the returned 3-tuple are around the pitch, roll and yaw directions respectively. This corresponds to the vessels reference frame (:func:`krpc_SpaceCenter_EditorVessel_ReferenceFrame`). :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_InertiaTensor(krpc_connection_t connection, krpc_list_double_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The inertia tensor of the vessel around its center of mass, in the vessels reference frame (:func:`krpc_SpaceCenter_EditorVessel_ReferenceFrame`). Returns the 3x3 matrix as a list of elements, in row-major order. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_ReferenceFrame(krpc_connection_t connection, krpc_SpaceCenter_ReferenceFrame_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The reference frame that is fixed relative to the vessel, and orientated with the vessel. * The origin is at the center of mass of the vessel. * The axes rotate with the vessel. * The x-axis points out to the right of the vessel. * The y-axis points in the forward direction of the vessel. * The z-axis points out of the bottom off the vessel. :Game Scenes: Editor Vab, Editor Sph .. note:: The axes are those of the root part. This is the frame :func:`krpc_SpaceCenter_Vessel_ReferenceFrame` gives at launch, with the root part as the control point. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_SurfaceReferenceFrame(krpc_connection_t connection, krpc_SpaceCenter_ReferenceFrame_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The reference frame that is fixed relative to the vessel, and orientated with the vertical of the editor. * The origin is at the center of mass of the vessel. * The axes are fixed in the editor. * The x-axis points upwards. * The y-axis and z-axis are horizontal. :Game Scenes: Editor Vab, Editor Sph .. note:: This is the vessel as it stands in the editor, and as it stands at launch. The editor has no north or east, so the horizontal axes are fixed in the editor. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Flight(krpc_connection_t connection, krpc_SpaceCenter_SimulatedFlight_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, krpc_SpaceCenter_ReferenceFrame_t referenceFrame) Returns a :type:`krpc_SpaceCenter_SimulatedFlight_t` object that can be used to simulate the vessel in flight, in the specified reference frame. :Parameters: * **referenceFrame** -- Reference frame. Defaults to the simulated surface reference frame (:func:`krpc_SpaceCenter_SimulatedFlight_SurfaceReferenceFrame`), and follows it when it is set. :Game Scenes: Editor Vab, Editor Sph .. note:: Each call returns a new object, which is kept until the game leaves the editor. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Position(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, krpc_SpaceCenter_ReferenceFrame_t referenceFrame) The position of the center of mass of the vessel, in the given reference frame. :Parameters: * **referenceFrame** -- The reference frame that the returned position vector is in. :returns: The position as a vector. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_BoundingBox(krpc_connection_t connection, krpc_SpaceCenter_BoundingBox_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, krpc_SpaceCenter_ReferenceFrame_t referenceFrame) The axis-aligned bounding box of the vessel in the given reference frame. :Parameters: * **referenceFrame** -- The reference frame that the returned position vectors are in. :returns: The positions of the minimum and maximum vertices of the box. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Rotation(krpc_connection_t connection, krpc_tuple_double_double_double_double_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, krpc_SpaceCenter_ReferenceFrame_t referenceFrame) The rotation of the vessel, in the given reference frame. :Parameters: * **referenceFrame** -- The reference frame that the returned rotation is in. :returns: The rotation as a quaternion of the form :math:`(x, y, z, w)`. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Direction(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, krpc_SpaceCenter_ReferenceFrame_t referenceFrame) The direction in which the vessel is pointing, in the given reference frame. :Parameters: * **referenceFrame** -- The reference frame that the returned direction is in. :returns: The direction as a unit vector. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Cost(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The total cost of the vessel, including resources, in funds. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_CrewCapacity(krpc_connection_t connection, int32_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) The total number of crew that the vessel can hold. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Parts(krpc_connection_t connection, krpc_SpaceCenter_Parts_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) A :type:`krpc_SpaceCenter_Parts_t` object, that can be used to interact with the parts that make up the vessel. :Game Scenes: Editor Vab, Editor Sph .. note:: Only the parts of :type:`krpc_SpaceCenter_Part_t` that describe the design are available in the editor. Those that need a vessel in flight or running physics, such as the thermal members, are restricted to the flight scene. :func:`krpc_SpaceCenter_Part_Position`, :func:`krpc_SpaceCenter_Part_CenterOfMass`, :func:`krpc_SpaceCenter_Part_Direction`, :func:`krpc_SpaceCenter_Part_Rotation`, :func:`krpc_SpaceCenter_Part_BoundingBox`, the part's reference frames, :func:`krpc_SpaceCenter_Part_MomentOfInertia` and :func:`krpc_SpaceCenter_Part_InertiaTensor` are available. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Resources(krpc_connection_t connection, krpc_SpaceCenter_Resources_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) A :func:`krpc_SpaceCenter_EditorVessel_Resources` object for the resources the vessel can hold. :Game Scenes: Editor Vab, Editor Sph .. note:: This is a view of what the vessel can hold as designed. The flow-state members work, as they are part of the design, but nothing here reports how a resource would be drawn on in flight. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_Stages(krpc_connection_t connection, krpc_list_object_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Activation (burn) stages for the vessel, in ascending stage order. This does not include the -1 stage (parts with no staging icon), as it carries no delta-v; use :func:`krpc_SpaceCenter_EditorVessel_StageAt` with -1 to get those parts. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_StageAt(krpc_connection_t connection, krpc_SpaceCenter_Stage_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, int32_t stage) The activation stage with the given number. Pass -1 to get the parts that are never activated (those with no staging icon). :Parameters: * **stage** -- Get activation stage at this index. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_DecoupleStages(krpc_connection_t connection, krpc_list_object_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Decouple stages for the vessel, in ascending stage order. The -1 stage, containing the parts that are never decoupled and remain on the vessel, is included first when any such parts exist. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_DecoupleStageAt(krpc_connection_t connection, krpc_SpaceCenter_Stage_t * returnValue, krpc_SpaceCenter_EditorVessel_t instance, int32_t stage) The decouple stage with the given number. Pass -1 to get the parts that are never decoupled and remain on the vessel after all stages have fired. :Parameters: * **stage** -- Get decouple stage at this index. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_DeltaVReady(krpc_connection_t connection, bool * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Whether the stock delta-v figures for the vessel have been calculated. :Game Scenes: Editor Vab, Editor Sph .. note:: The game recalculates them in the background whenever the vessel changes, and whenever :func:`krpc_SpaceCenter_Editor_DeltaVBody` or :func:`krpc_SpaceCenter_Editor_DeltaVAltitude` is set, and they are out of date until it has finished. Reading :func:`krpc_SpaceCenter_EditorVessel_DeltaV`, or any delta-v member of a :type:`krpc_SpaceCenter_Stage_t`, before then raises an error rather than returning a stale figure. Poll this after changing anything the figures depend on. .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_DeltaV(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Total delta-v for the vessel in the situation the game's delta-v readout assumes, in m/s. See :func:`krpc_SpaceCenter_Editor_DeltaVBody`. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_VacuumDeltaV(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Total vacuum delta-v for the vessel, in m/s. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_SeaLevelDeltaV(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Total sea-level delta-v for the vessel, in m/s. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_EditorVessel_BurnTime(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_EditorVessel_t instance) Total burn time for the vessel, in seconds. :Game Scenes: Editor Vab, Editor Sph .. type:: krpc_SpaceCenter_SimulatedFlight_t Used to simulate the vessel in the editor in flight. The counterpart of :type:`krpc_SpaceCenter_Flight_t`. All of the information returned by this class is given in the reference frame passed to :func:`krpc_SpaceCenter_EditorVessel_Flight`, or in :func:`krpc_SpaceCenter_SimulatedFlight_SurfaceReferenceFrame` if none was passed. Obtained by calling :func:`krpc_SpaceCenter_EditorVessel_Flight`. .. note:: The simulated attitude is set by :func:`krpc_SpaceCenter_SimulatedFlight_SurfaceReferenceFrame`, and belongs to this object. The vessel is read from the editor on each call, so the object follows every edit. .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_SurfaceReferenceFrame(krpc_connection_t connection, krpc_SpaceCenter_ReferenceFrame_t * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_set_SurfaceReferenceFrame(krpc_connection_t connection, krpc_SpaceCenter_SimulatedFlight_t instance, krpc_SpaceCenter_ReferenceFrame_t value) The reference frame of the surface the vessel is simulated over. Its x-axis points upwards, and gravity acts along the negative x-axis. Defaults to :func:`krpc_SpaceCenter_EditorVessel_SurfaceReferenceFrame`. :Game Scenes: Editor Vab, Editor Sph .. note:: Only the rotation of the frame is used. A frame created relative to :func:`krpc_SpaceCenter_EditorVessel_ReferenceFrame` follows the vessel as it is edited. .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_CenterOfMass(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) The position of the center of mass of the vessel, in the reference frame :type:`krpc_SpaceCenter_ReferenceFrame_t` :returns: The position as a vector. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_Rotation(krpc_connection_t connection, krpc_tuple_double_double_double_double_t * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) The rotation of the vessel, in the reference frame :type:`krpc_SpaceCenter_ReferenceFrame_t` :returns: The rotation as a quaternion of the form :math:`(x, y, z, w)`. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_Direction(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) The direction that the vessel is pointing in, in the reference frame :type:`krpc_SpaceCenter_ReferenceFrame_t`. :returns: The direction as a unit vector. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_Pitch(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) The pitch of the vessel relative to the horizon, in degrees. A value between -90° and +90°. :Game Scenes: Editor Vab, Editor Sph .. note:: An absolute Euler angle, ill-conditioned when the vessel points near vertical (a pitch near -90° or +90°). For an always-defined attitude use :func:`krpc_SpaceCenter_SimulatedFlight_Rotation` or :func:`krpc_SpaceCenter_SimulatedFlight_Direction`. .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_Roll(krpc_connection_t connection, float * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) The roll of the vessel relative to the horizon, in degrees. A value between -180° and +180°. :Game Scenes: Editor Vab, Editor Sph .. note:: An absolute Euler angle, ill-conditioned when the vessel points near vertical (a pitch near -90° or +90°). For an always-defined attitude use :func:`krpc_SpaceCenter_SimulatedFlight_Rotation`. .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_Displacement(krpc_connection_t connection, double * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance) The volume of water the vessel displaces when fully submerged, in :math:`m^3`. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_FullySubmergedCenterOfBuoyancy(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, bool * returnValueIsNull, krpc_SpaceCenter_SimulatedFlight_t instance) The point the buoyant force acts through with the vessel fully submerged, in reference frame :type:`krpc_SpaceCenter_ReferenceFrame_t`. Returns ``nullptr`` if no part of the vessel displaces any water. :returns: The position as a vector. :Game Scenes: Editor Vab, Editor Sph .. note:: A hull at rest carries this on the same vertical line as :func:`krpc_SpaceCenter_SimulatedFlight_CenterOfMass`. .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_BuoyantForceAt(krpc_connection_t connection, double * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance, double density, double gravity) The buoyant force on the vessel when fully submerged in a fluid of the given density, in Newtons. :Parameters: * **density** -- The density of the fluid, in :math:`kg/m^3`. * **gravity** -- The acceleration due to gravity, in :math:`m/s^2`. :Game Scenes: Editor Vab, Editor Sph .. function:: krpc_error_t krpc_SpaceCenter_SimulatedFlight_BuoyantTorqueAt(krpc_connection_t connection, krpc_tuple_double_double_double_t * returnValue, krpc_SpaceCenter_SimulatedFlight_t instance, double density, double gravity) The torque the buoyant force exerts about the vessel's center of mass when fully submerged in a fluid of the given density, in reference frame :type:`krpc_SpaceCenter_ReferenceFrame_t`. Gravity acts along the negative x-axis of :func:`krpc_SpaceCenter_SimulatedFlight_SurfaceReferenceFrame`. :Parameters: * **density** -- The density of the fluid, in :math:`kg/m^3`. * **gravity** -- The acceleration due to gravity, in :math:`m/s^2`. :returns: A vector pointing along the axis of the torque, with its magnitude equal to the strength of the torque in newton-meters. :Game Scenes: Editor Vab, Editor Sph