.. default-domain:: js .. highlight:: js .. module:: SpaceCenter :no-index: .. _js-api-parts: Parts ===== The following classes allow interaction with a vessel's individual parts. .. seealso:: The :std:ref:`parts guide ` walks the tree of parts, and explains fuel lines, stage numbers and part modules. .. contents:: :local: Parts ----- .. class:: Parts Instances of this class are used to interact with the parts of a vessel. An instance can be obtained by calling :meth:`SpaceCenter.Vessel.getParts`. .. method:: getAll() A list of all of the vessels parts. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Part` .. method:: getRoot() The vessels root part. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` .. note:: See the discussion on :rst:ref:`user-guide-parts-tree`. .. method:: getControlling() setControlling(value) The part from which the vessel is controlled. Returns ``null`` if the vessel has no control point, in which case it is oriented by its root part. :Property: Can be read or written :rtype: :class:`SpaceCenter.Part` or ``null`` :Game Scenes: Flight .. note:: A vessel gets no control point when it is created by a decoupler or an undocking and none of its parts is a command module with crew aboard. A probe core does not give it one either. Assign this property to choose the control point, which is equivalent to "Control From Here" in game. .. method:: withName(name) A list of parts whose :meth:`SpaceCenter.Part.getName` is *name*. :param name: The name of the part. :type name: ``string`` :rtype: ``Array`` of :class:`SpaceCenter.Part` .. method:: withTitle(title) A list of all parts whose :meth:`SpaceCenter.Part.getTitle` is *title*. :param title: The title of the part. :type title: ``string`` :rtype: ``Array`` of :class:`SpaceCenter.Part` .. method:: withTag(tag) A list of all parts whose :meth:`SpaceCenter.Part.getTag` is *tag*. :param tag: The name tag of the part. :type tag: ``string`` :rtype: ``Array`` of :class:`SpaceCenter.Part` .. method:: withModule(moduleName) A list of all parts that contain a :class:`SpaceCenter.Module` whose :meth:`SpaceCenter.Module.getName` is *moduleName*. :param moduleName: The name of the module. :type moduleName: ``string`` :rtype: ``Array`` of :class:`SpaceCenter.Part` .. method:: modulesWithName(moduleName) A list of modules (combined across all parts in the vessel) whose :meth:`SpaceCenter.Module.getName` is *moduleName*. :param moduleName: The name of the module. :type moduleName: ``string`` :rtype: ``Array`` of :class:`SpaceCenter.Module` .. method:: getAntennas() A list of all antennas in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Antenna` .. note:: A part with several antennas has an entry for each. If RemoteTech is installed, this will always return an empty list. To interact with RemoteTech antennas, use the RemoteTech service APIs. .. method:: getCargoBays() A list of all cargo bays in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.CargoBay` .. method:: getControlSurfaces() A list of all control surfaces in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ControlSurface` .. method:: getDecouplers() A list of all decouplers in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Decoupler` .. method:: getDockingPorts() A list of all docking ports in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.DockingPort` .. method:: getEngines() A list of all engines in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Engine` .. note:: This includes any part that generates thrust. This covers many different types of engine, including liquid fuel rockets, solid rocket boosters, jet engines and RCS thrusters. .. method:: getExperiments() A list of all science experiments in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Experiment` .. method:: getFairings() A list of all fairings in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Fairing` .. method:: getIntakes() A list of all intakes in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Intake` .. method:: getLegs() A list of all landing legs attached to the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Leg` .. method:: getLaunchClamps() A list of all launch clamps attached to the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.LaunchClamp` .. method:: getLights() A list of all lights in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Light` .. method:: getParachutes() A list of all parachutes in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Parachute` .. method:: getRadiators() A list of all radiators in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Radiator` .. method:: getResourceDrains() A list of all resource drains in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ResourceDrain` .. method:: getRCS() A list of all RCS blocks/thrusters in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.RCS` .. method:: getReactionWheels() A list of all reaction wheels in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ReactionWheel` .. method:: getResourceConverters() A list of all resource converters in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ResourceConverter` .. method:: getResourceHarvesters() A list of all resource harvesters in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ResourceHarvester` .. method:: getRoboticControllers() A list of all robotic controllers in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.RoboticController` .. method:: getRoboticHinges() A list of all robotic hinges in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.RoboticHinge` .. method:: getRoboticPistons() A list of all robotic pistons in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.RoboticPiston` .. method:: getRoboticRotations() A list of all robotic rotations in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.RoboticRotation` .. method:: getRoboticRotors() A list of all robotic rotors in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.RoboticRotor` .. method:: getSensors() A list of all sensors in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Sensor` .. method:: getSolarPanels() A list of all solar panels in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.SolarPanel` .. method:: getWheels() A list of all wheels in the vessel. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Wheel` Part ---- .. class:: Part Represents an individual part. Vessels are made up of multiple parts. Instances of this class can be obtained by several methods in :class:`SpaceCenter.Parts`. .. method:: getName() Internal name of the part, as used in `part cfg files `_. For example "Mark1-2Pod". :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getTitle() Title of the part, as shown when the part is right clicked in-game. For example "Mk1-2 Command Pod". :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getConfig() The static configuration of the part, as found in its `part cfg file `_. This provides access to data that is not exposed elsewhere, such as the configuration of the part's modules. Returns ``null`` if the part has no associated configuration node. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ConfigNode` .. method:: getTag() setTag(value) The name tag for the part. Can be set to a custom string using the in-game user interface. Throws an exception if no name tag part module is installed. :Property: Can be read or written :rtype: ``string`` .. note:: Requires KSPCommunityPartModules 0.5 or later, or kOS, which share one name tag. .. method:: getFlagURL() setFlagURL(value) The asset URL for the part's flag. :Property: Can be read or written :rtype: ``string`` .. method:: getHighlighted() setHighlighted(value) Whether the part is highlighted. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. note:: The highlighting is removed when the client that enabled it disconnects. .. method:: getHighlightColor() setHighlightColor(value) The color used to highlight the part. :Property: Can be read or written :rtype: :class:`StdLib.ColorRGB` :Game Scenes: Flight .. method:: getCost() The cost of the part with its resources full, in units of funds. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getVessel() The vessel that contains this part. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Vessel` :Game Scenes: Flight .. method:: getParent() The parts parent. Returns ``null`` if the part does not have a parent. This, in combination with :meth:`SpaceCenter.Part.getChildren`, can be used to traverse the vessels parts tree. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` or ``null`` .. note:: See the discussion on :rst:ref:`user-guide-parts-tree`. .. method:: getChildren() The parts children. Returns an empty list if the part has no children. This, in combination with :meth:`SpaceCenter.Part.getParent`, can be used to traverse the vessels parts tree. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Part` .. note:: See the discussion on :rst:ref:`user-guide-parts-tree`. .. method:: getAxiallyAttached() Whether the part is axially attached to its parent, i.e. on the top or bottom of its parent. If the part has no parent, returns ``false``. :Property: Read-only, cannot be set :rtype: ``boolean`` .. note:: See the discussion on :rst:ref:`user-guide-parts-attachment-modes`. .. method:: getRadiallyAttached() Whether the part is radially attached to its parent, i.e. on the side of its parent. If the part has no parent, returns ``false``. :Property: Read-only, cannot be set :rtype: ``boolean`` .. note:: See the discussion on :rst:ref:`user-guide-parts-attachment-modes`. .. method:: getStage() The stage in which this part will be activated. Returns -1 if the part is not activated by staging. :Property: Read-only, cannot be set :rtype: ``number`` .. note:: See the discussion on :rst:ref:`user-guide-parts-staging`. .. method:: getDecoupleStage() The stage in which this part will be decoupled. Returns -1 if the part is never decoupled from the vessel. :Property: Read-only, cannot be set :rtype: ``number`` .. note:: See the discussion on :rst:ref:`user-guide-parts-staging`. .. method:: getMassless() Whether the part is `massless `_. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getMass() The current mass of the part, including resources it contains, in kilograms. Returns zero if the part is massless. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getDryMass() The mass of the part, not including any resources it contains, in kilograms. Returns zero if the part is massless. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getShielded() Whether the part is shielded from the exterior of the vessel, for example by a fairing. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getDynamicPressure() The dynamic pressure acting on the part, in Pascals. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getStaticPressure() The static pressure acting on the part, in Pascals. Below the waterline this includes the pressure of the water. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getDisplacement() The volume of water the part displaces when fully submerged, in :math:`\mathrm{m^{3}}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: See :meth:`SpaceCenter.Part.getDisplacedVolume` for the volume it is displacing now. .. method:: getBuoyancyMultiplier() The multiplier applied to the buoyant force on the part. One for most parts. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: buoyantForceAt(density, gravity) The buoyant force on the part when fully submerged in a fluid of the given density, in Newtons. :param density: The density of the fluid, in :math:`\mathrm{kg/m^{3}}`. :type density: ``number`` :param gravity: The acceleration due to gravity, in :math:`\mathrm{m/s^{2}}`. :type gravity: ``number`` :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Applies :func:`SpaceCenter.getBuoyancyScalar` and :meth:`SpaceCenter.Part.getBuoyancyMultiplier`, so the result is what the game would do to the part rather than what `Archimedes' principle `_ alone gives. .. method:: getSplashed() Whether the part is in contact with water. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getSubmergedPortion() The fraction of the part below the waterline, between 0 and 1. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getDisplacedVolume() The volume of water the part is displacing, in :math:`\mathrm{m^{3}}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getDepth() The depth of the part below the waterline, in meters, measured at :meth:`SpaceCenter.Part.centerOfDisplacement`. Negative above the waterline. Returns zero if the body the vessel is at has no ocean. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMinDepth() The depth of the shallowest point of the part below the waterline, in meters. Returns zero if the body the vessel is at has no ocean. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxDepth() The depth of the deepest point of the part below the waterline, in meters. Returns zero if the body the vessel is at has no ocean. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The game ramps the buoyant force in over the first fraction of a meter of this depth. .. method:: getSubmergedDynamicPressure() The dynamic pressure of the water acting on the part, in Pascals. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getSubmergedDragMultiplier() The multiplier applied to the drag on the part while it is submerged. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The game sets this high on splashdown and eases it down as the part moves through the water. It climbs back once the part slows to a crawl, so a hull under way reads lower than one lying still. .. method:: getSubmergedLiftMultiplier() The multiplier applied to the lift on the part while it is submerged. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getWaterAngularDragMultiplier() The multiplier applied to the angular drag on the part while it is submerged. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Part of the part's configuration rather than a live readout, so it reads the same in the editor and at a body with no ocean. .. method:: getImpactTolerance() The crash tolerance of the part, in :math:`\mathrm{m/s}`. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getBreakingForce() The breaking force of the part's attachments, in :math:`\mathrm{kN}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: The joint to the parent part takes the lower breaking force of the two parts, scaled by the size of the attachment node. See :meth:`SpaceCenter.Part.getJointBreakForce`. .. method:: getBreakingTorque() The breaking torque of the part's attachments, in :math:`\mathrm{kN \cdot m}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: The joint to the parent part takes the lower breaking torque of the two parts, scaled by the size of the attachment node. See :meth:`SpaceCenter.Part.getJointBreakTorque`. .. method:: getJointBreakForce() The force that breaks the joint to the parent part, in :math:`\mathrm{kN}`. Throws an exception if the part has no joint to its parent part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The sum over the joint's physics joints. It is infinite for a short time after the vessel loads, such as just after launch. The root part and a physicsless part have no joint to their parent. .. method:: getJointBreakTorque() The torque that breaks the joint to the parent part, in :math:`\mathrm{kN \cdot m}`. Throws an exception if the part has no joint to its parent part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The sum over the joint's physics joints. It is infinite for a short time after the vessel loads. On a stack node of size 2 or more, the physics joints sit apart around the node. A bending moment then breaks the joint when one physics joint's force exceeds its share of :meth:`SpaceCenter.Part.getJointBreakForce`, usually at a much larger moment than this torque. .. method:: getJointSpring() The spring constant of the joint to the parent part against translation, in :math:`\mathrm{kN/m}`. Throws an exception if the part has no joint to its parent part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The sum over the joint's physics joints. A rigid attachment locks the joint, and this spring then has no effect. .. method:: getJointDamper() The damping constant of the joint to the parent part against translation, in :math:`\mathrm{kN \cdot s/m}`. Throws an exception if the part has no joint to its parent part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The sum over the joint's physics joints. The stock game sets it to zero, and mods such as Kerbal Joint Reinforcement change it. .. method:: getJointAngularSpring() The spring constant of the joint to the parent part against bending, in :math:`\mathrm{kN \cdot m/rad}`. Throws an exception if the part has no joint to its parent part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The sum over the joint's physics joints, about the two axes perpendicular to the joint axis. The joint is far stiffer against twisting about its axis. On a stack node of size 2 or more, the physics joints sit apart around the node, and the joint bends much less than this spring gives. A rigid attachment makes it infinite. .. method:: getJointAngularDamper() The damping constant of the joint to the parent part against bending, in :math:`\mathrm{kN \cdot m \cdot s/rad}`. Throws an exception if the part has no joint to its parent part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The sum over the joint's physics joints. The stock game sets it to zero, and mods such as Kerbal Joint Reinforcement change it. .. method:: getTemperature() Temperature of the part, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getSkinTemperature() Temperature of the skin of the part, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxTemperature() Maximum temperature that the part can survive, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getMaxSkinTemperature() Maximum temperature that the skin of the part can survive, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getMaxPressure() Maximum pressure that the part can survive, in Pascals. :Property: Read-only, cannot be set :rtype: ``number`` .. note:: With part pressure limits enabled in the difficulty settings, the part is destroyed when :meth:`SpaceCenter.Part.getStaticPressure` plus :meth:`SpaceCenter.Part.getDynamicPressure` exceeds this. .. method:: getThermalMass() A measure of how much energy it takes to increase the internal temperature of the part, in Joules per Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalSkinMass() A measure of how much energy it takes to increase the skin temperature of the part, in Joules per Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalResourceMass() A measure of how much energy it takes to increase the temperature of the resources contained in the part, in Joules per Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalConductionFlux() The rate at which heat energy is conducting into or out of the part via contact with other parts. Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalConvectionFlux() The rate at which heat energy is convecting into or out of the part from the surrounding atmosphere. Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalRadiationFlux() The rate at which heat energy is radiating into or out of the part from the surrounding environment. Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalInternalFlux() The rate at which heat energy is begin generated by the part. For example, some engines generate heat by combusting fuel. Measured in energy per unit time, or power, in Watts. A positive value means the part is gaining heat energy, and negative means it is losing heat energy. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalSkinToInternalFlux() The rate at which heat energy is transferring between the part's skin and its internals. Measured in energy per unit time, or power, in Watts. A positive value means the part's internals are gaining heat energy, and negative means its skin is gaining heat energy. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getCrewCapacity() The number of crew members that can occupy the part. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getCrew() The crew members occupying the part. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.CrewMember` :Game Scenes: Flight .. method:: getAvailableSeats() How many open seats the part has. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getResources() A :meth:`SpaceCenter.Part.getResources` object for the part. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Resources` .. method:: getCrossfeed() Whether this part is crossfeed capable. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getIsFuelLine() Whether this part is a fuel line. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getFuelLinesFrom() The parts that are connected to this part via fuel lines, where the direction of the fuel line is into this part. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Part` :Game Scenes: Flight .. note:: See the discussion on :rst:ref:`user-guide-parts-fuel-lines`. .. method:: getFuelLinesTo() The parts that are connected to this part via fuel lines, where the direction of the fuel line is out of this part. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Part` :Game Scenes: Flight .. note:: See the discussion on :rst:ref:`user-guide-parts-fuel-lines`. .. method:: getModules() The modules for this part. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Module` .. method:: getAntenna() An :meth:`SpaceCenter.Part.getAntenna` if the part is an antenna, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Antenna` or ``null`` .. note:: For a part with several antennas, this is the first. :meth:`SpaceCenter.Parts.getAntennas` lists them all. If RemoteTech is installed, this will always return ``null``. To interact with RemoteTech antennas, use the RemoteTech service APIs. .. method:: getCargoBay() A :meth:`SpaceCenter.Part.getCargoBay` if the part is a cargo bay, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.CargoBay` or ``null`` .. method:: getControlSurface() A :meth:`SpaceCenter.Part.getControlSurface` if the part is an aerodynamic control surface, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ControlSurface` or ``null`` .. method:: getDecoupler() A :meth:`SpaceCenter.Part.getDecoupler` if the part is a decoupler, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Decoupler` or ``null`` .. method:: getDockingPort() A :meth:`SpaceCenter.Part.getDockingPort` if the part is a docking port, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DockingPort` or ``null`` .. method:: getEngine() An :meth:`SpaceCenter.Part.getEngine` if the part is an engine, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Engine` or ``null`` .. method:: getExperiment() An :meth:`SpaceCenter.Part.getExperiment` if the part contains a single science experiment, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Experiment` or ``null`` .. note:: Throws an exception if the part contains more than one experiment. In that case, use :meth:`SpaceCenter.Part.getExperiments` to get the list of experiments in the part. .. method:: getExperiments() A list of :meth:`SpaceCenter.Part.getExperiment` objects that the part contains. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Experiment` or ``null`` .. method:: getFairing() A :meth:`SpaceCenter.Part.getFairing` if the part is a fairing, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Fairing` or ``null`` .. method:: getIntake() An :meth:`SpaceCenter.Part.getIntake` if the part is an intake, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Intake` or ``null`` .. note:: This includes any part that generates thrust. This covers many different types of engine, including liquid fuel rockets, solid rocket boosters and jet engines. For RCS thrusters see :meth:`SpaceCenter.Part.getRCS`. .. method:: getLeg() A :meth:`SpaceCenter.Part.getLeg` if the part is a landing leg, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Leg` or ``null`` .. method:: getLaunchClamp() A :meth:`SpaceCenter.Part.getLaunchClamp` if the part is a launch clamp, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.LaunchClamp` or ``null`` .. method:: getLight() A :meth:`SpaceCenter.Part.getLight` if the part is a light, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Light` or ``null`` .. method:: getParachute() A :meth:`SpaceCenter.Part.getParachute` if the part is a parachute, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Parachute` or ``null`` .. method:: getRadiator() A :meth:`SpaceCenter.Part.getRadiator` if the part is a radiator, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Radiator` or ``null`` .. method:: getResourceDrain() A :meth:`SpaceCenter.Part.getResourceDrain` if the part is a resource drain, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ResourceDrain` or ``null`` .. method:: getRCS() A :meth:`SpaceCenter.Part.getRCS` if the part is an RCS block/thruster, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.RCS` or ``null`` .. method:: getReactionWheel() A :meth:`SpaceCenter.Part.getReactionWheel` if the part is a reaction wheel, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ReactionWheel` or ``null`` .. method:: getResourceConverter() A :meth:`SpaceCenter.Part.getResourceConverter` if the part is a resource converter, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ResourceConverter` or ``null`` .. method:: getResourceHarvester() A :meth:`SpaceCenter.Part.getResourceHarvester` if the part is a resource harvester, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ResourceHarvester` or ``null`` .. method:: getRoboticController() A :meth:`SpaceCenter.Part.getRoboticController` if the part is a robotic controller, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.RoboticController` or ``null`` .. method:: getRoboticHinge() A :meth:`SpaceCenter.Part.getRoboticHinge` if the part is a robotic hinge, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.RoboticHinge` or ``null`` .. method:: getRoboticPiston() A :meth:`SpaceCenter.Part.getRoboticPiston` if the part is a robotic piston, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.RoboticPiston` or ``null`` .. method:: getRoboticRotation() A :meth:`SpaceCenter.Part.getRoboticRotation` if the part is a robotic rotation servo, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.RoboticRotation` or ``null`` .. method:: getRoboticRotor() A :meth:`SpaceCenter.Part.getRoboticRotor` if the part is a robotic rotor, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.RoboticRotor` or ``null`` .. method:: getSensor() A :meth:`SpaceCenter.Part.getSensor` if the part is a sensor, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Sensor` or ``null`` .. method:: getSolarPanel() A :meth:`SpaceCenter.Part.getSolarPanel` if the part is a solar panel, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.SolarPanel` or ``null`` .. method:: getWheel() A :meth:`SpaceCenter.Part.getWheel` if the part is a wheel, otherwise ``null``. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Wheel` or ``null`` .. method:: position(referenceFrame) The position of the part in the given reference frame. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: This is a fixed position in the part, defined by the parts model. It s not necessarily the same as the parts center of mass. Use :meth:`SpaceCenter.Part.centerOfMass` to get the parts center of mass. .. method:: centerOfMass(referenceFrame) The position of the parts center of mass in the given reference frame. If the part is physicsless in flight, this is equivalent to :meth:`SpaceCenter.Part.position`. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: boundingBox(referenceFrame) The axis-aligned bounding box of the part in the given reference frame. :param referenceFrame: The reference frame that the returned position vectors are in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The positions of the minimum and maximum vertices of the box. :rtype: :class:`SpaceCenter.BoundingBox` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: This is computed from the meshes that make up the parts model, and covers only this part - the models of any child parts are excluded. If the part has no visible model, the box has zero volume and is centered on the :meth:`SpaceCenter.Part.centerOfMass` of the part. .. method:: direction(referenceFrame) The direction the part points in, in the given reference frame. :param referenceFrame: The reference frame that the returned direction is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The direction as a unit vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: velocity(referenceFrame) The linear velocity of the part in the given reference frame. :param referenceFrame: The reference frame that the returned velocity vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The velocity as a vector. The vector points in the direction of travel, and its magnitude is the speed of the body in :math:`\mathrm{m/s}`. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: rotation(referenceFrame) The rotation of the part, in the given reference frame. :param referenceFrame: The reference frame that the returned rotation is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The rotation as a quaternion of the form ``(x, y, z, w)``. :rtype: ``[number, number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: lift(referenceFrame) The aerodynamic `lift `_ currently acting on the part. :param referenceFrame: The reference frame that the returned vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: Not available when Ferram Aerospace Research is installed. .. method:: drag(referenceFrame) The aerodynamic `drag `_ currently acting on the part. :param referenceFrame: The reference frame that the returned vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: Not available when Ferram Aerospace Research is installed. .. method:: centerOfBuoyancy(referenceFrame) The point the buoyant force on the part acts at, in the given reference frame. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: A submerged part reports the point the game applied the force at, which it shifts towards the submerged part of the hull. Any other part reports its configured center of buoyancy. .. method:: centerOfDisplacement(referenceFrame) The point the depth of the part is measured at, in the given reference frame. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: buoyantForce(referenceFrame) The buoyant force currently acting on the part. :param referenceFrame: The reference frame that the returned vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: The buoyant force on its own. The water drag and lift the game applies alongside it are reported by :meth:`SpaceCenter.Part.getSubmergedDragMultiplier` and :meth:`SpaceCenter.Part.getSubmergedLiftMultiplier`. .. method:: getMomentOfInertia() The moment of inertia of the part in :math:`\mathrm{kg \cdot m^{2}}` around its center of mass in the parts center of mass reference frame (:meth:`SpaceCenter.Part.getCenterOfMassReferenceFrame`). :Property: Read-only, cannot be set :rtype: ``[number, number, number]`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getInertiaTensor() The inertia tensor of the part around its center of mass, in the parts center of mass reference frame (:meth:`SpaceCenter.Part.getCenterOfMassReferenceFrame`). Returns the 3x3 matrix as a list of elements, in row-major order. :Property: Read-only, cannot be set :rtype: ``Array`` of ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getReferenceFrame() The reference frame that is fixed relative to this part, and centered on a fixed position within the part, defined by the parts model. * The origin is at the position of the part, as returned by :meth:`SpaceCenter.Part.position`. * The axes rotate with the part. * The x, y and z axis directions depend on the design of the part. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ReferenceFrame` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: For docking port parts, this reference frame is not necessarily equivalent to the reference frame for the docking port, returned by :meth:`SpaceCenter.DockingPort.getReferenceFrame`. .. figure:: /images/reference-frames/part.png :align: center Mk1 Command Pod reference frame origin and axes .. method:: getCenterOfMassReferenceFrame() The reference frame that is fixed relative to this part, and centered on its center of mass. * The origin is at the center of mass of the part, as returned by :meth:`SpaceCenter.Part.centerOfMass`. * The axes rotate with the part. * The x, y and z axis directions depend on the design of the part. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ReferenceFrame` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: For docking port parts, this reference frame is not necessarily equivalent to the reference frame for the docking port, returned by :meth:`SpaceCenter.DockingPort.getReferenceFrame`. .. method:: addForce(force, position, referenceFrame) .. warning:: Deprecated. Use ``Debug.AddForce`` instead. Exert a constant force on the part, acting at the given position. :param force: A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons. :type force: ``[number, number, number]`` :param position: The position at which the force acts, as a vector. :type position: ``[number, number, number]`` :param referenceFrame: The reference frame that the force and position are in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: An object that can be used to remove or modify the force. :rtype: :class:`SpaceCenter.Force` :Game Scenes: Flight .. note:: The force is removed when the client that added it disconnects. .. method:: instantaneousForce(force, position, referenceFrame) .. warning:: Deprecated. Use ``Debug.InstantaneousForce`` instead. Exert an instantaneous force on the part, acting at the given position. :param force: A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons. :type force: ``[number, number, number]`` :param position: The position at which the force acts, as a vector. :type position: ``[number, number, number]`` :param referenceFrame: The reference frame that the force and position are in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :Game Scenes: Flight .. note:: The force is applied instantaneously in a single physics update. .. method:: setGlow(value) Whether the part is glowing. :Property: Write-only, cannot be read :rtype: ``boolean`` :Game Scenes: Flight .. method:: getAutoStrutMode() Auto-strut mode. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AutoStrutMode` .. method:: getHasRealFuelsTank() Whether the part is a fuel tank managed by RealFuels. The remaining properties in this section are only available when it is. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getHighlyPressurized() Whether the tank is highly pressurized, which is what a pressure-fed engine needs to draw from (see :meth:`SpaceCenter.Engine.getPressureFed`). Throws an exception if the part is not a RealFuels fuel tank (see :meth:`SpaceCenter.Part.getHasRealFuelsTank`). :Property: Read-only, cannot be set :rtype: ``boolean`` .. note:: Requires RealFuels. .. method:: getBoiloffRate() The rate at which the tank's cryogenic contents are boiling off, in kilograms per second of in-game time, measured over the last update RealFuels computed it in. The contents keep boiling off under time warp, where that update covers a much longer span of in-game time than a physics frame does. The rate is zero for a tank holding nothing cryogenic, for one still being fed by a launch clamp, whose temperature RealFuels holds down instead, and in the editor. Throws an exception if the part is not a RealFuels fuel tank (see :meth:`SpaceCenter.Part.getHasRealFuelsTank`). :Property: Read-only, cannot be set :rtype: ``number`` .. note:: Requires RealFuels. .. class:: AutoStrutMode The state of an auto-strut. :meth:`SpaceCenter.Part.getAutoStrutMode` .. attribute:: off Off .. attribute:: root Root .. attribute:: heaviest Heaviest .. attribute:: grandparent Grandparent .. attribute:: forceRoot ForceRoot .. attribute:: forceHeaviest ForceHeaviest .. attribute:: forceGrandparent ForceGrandparent .. class:: Force Obtained by calling ``Debug.AddForce``. .. method:: getPart() The part that this force is applied to. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight .. method:: getForceVector() setForceVector(value) The force vector, in Newtons. :Property: Can be read or written :returns: A vector pointing in the direction that the force acts, with its magnitude equal to the strength of the force in Newtons. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getPosition() setPosition(value) The position at which the force acts, in reference frame :meth:`SpaceCenter.Force.getReferenceFrame`. :Property: Can be read or written :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getReferenceFrame() setReferenceFrame(value) The reference frame of the force vector and position. :Property: Can be read or written :rtype: :class:`SpaceCenter.ReferenceFrame` :Game Scenes: Flight .. method:: remove() Remove the force. :Game Scenes: Flight .. note:: Any further use of this object throws an exception. Module ------ .. class:: Module This can be used to interact with a specific part module. This includes part modules in stock KSP, and those added by mods. In KSP, each part has zero or more `PartModules `_ associated with it. Each one contains some of the functionality of the part. For example, an engine has a "ModuleEngines" part module that contains all the functionality of an engine. .. method:: getName() Name of the PartModule. For example, "ModuleEngines". :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getPart() The part that contains this module. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` .. method:: getConfig() The static configuration of the module, as found in the part's `cfg file `_. This provides access to data that is not exposed as a field, such as the resources produced by a generator. Returns ``null`` if the module's configuration node cannot be found. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ConfigNode` .. method:: getFieldList() A list of all the fields of the module, including those not visible in the right-click menu of the part. Filter by :meth:`SpaceCenter.PartField.getVisible` to get just the visible ones. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.PartField` .. method:: getEventList() A list of all the events of the module, including those not currently visible or active. Events are the clickable buttons visible in the right-click menu of the part. Filter by :meth:`SpaceCenter.PartEvent.getVisible` and :meth:`SpaceCenter.PartEvent.getActive` to get just the ones shown in the menu. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.PartEvent` .. method:: getActionList() A list of all the actions of the module. These are the parts actions that can be assigned to action groups in the in-game editor. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.PartAction` .. class:: PartField A field of a part module. Obtained by calling :meth:`SpaceCenter.Module.getFieldList`. .. note:: Setting a field runs the callbacks that the right-click menu of the part runs. .. method:: getModule() The part module that contains this field. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Module` .. method:: getName() The identifier of the field. This is stable and does not change between game versions, unlike :meth:`SpaceCenter.PartField.getGuiName`. :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getGuiName() The name of the field, as displayed in the right-click menu of the part. This may be empty for fields that are not visible in the menu. :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getVisible() Whether the field is visible in the right-click menu of the part, in the current scene (flight or editor). :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getType() The type of the field. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.FieldType` .. method:: getValue() setValue(value) The value of the field, as a string. This works for fields of any type, and returns the same string that is shown in the right-click menu of the part. :Property: Can be read or written :rtype: ``string`` .. note:: Setting the value using this property is only permitted for string fields. Use the typed properties (:meth:`SpaceCenter.PartField.getBoolValue`, :meth:`SpaceCenter.PartField.getIntValue`, :meth:`SpaceCenter.PartField.getFloatValue`, :meth:`SpaceCenter.PartField.getDoubleValue`) to set fields of other types. .. method:: getBoolValue() setBoolValue(value) The value of a boolean field. :Property: Can be read or written :rtype: ``boolean`` .. note:: The getter throws an exception if the field is not a boolean field (see :meth:`SpaceCenter.PartField.getType`). .. method:: getIntValue() setIntValue(value) The value of an integer field. :Property: Can be read or written :rtype: ``number`` .. note:: The getter throws an exception if the field is not an integer field (see :meth:`SpaceCenter.PartField.getType`). .. method:: getFloatValue() setFloatValue(value) The value of a single precision floating point field. :Property: Can be read or written :rtype: ``number`` .. note:: The getter throws an exception if the field is not a single precision floating point field (see :meth:`SpaceCenter.PartField.getType`). .. method:: getDoubleValue() setDoubleValue(value) The value of a double precision floating point field. :Property: Can be read or written :rtype: ``number`` .. note:: The getter throws an exception if the field is not a double precision floating point field (see :meth:`SpaceCenter.PartField.getType`). .. method:: reset() Set the value of the field to its original value. .. note:: The original value is the value the field had when the part was loaded. Works for any field, including those not visible in the right-click menu. .. class:: FieldType The type of a part module field. See :meth:`SpaceCenter.PartField.getType`. .. attribute:: boolean A boolean field. Access using :meth:`SpaceCenter.PartField.getBoolValue`. .. attribute:: integer An integer field. Access using :meth:`SpaceCenter.PartField.getIntValue`. .. attribute:: float A single precision floating point field. Access using :meth:`SpaceCenter.PartField.getFloatValue`. .. attribute:: double A double precision floating point field. Access using :meth:`SpaceCenter.PartField.getDoubleValue`. .. attribute:: string A string field. Access using :meth:`SpaceCenter.PartField.getValue`. .. attribute:: unknown A field whose type is not one of the above. Its value can still be read as a string using :meth:`SpaceCenter.PartField.getValue`. .. class:: PartEvent An event of a part module. Events are the clickable buttons visible in the right-click menu of the part. Obtained by calling :meth:`SpaceCenter.Module.getEventList`. .. method:: getModule() The part module that contains this event. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Module` .. method:: getName() The identifier of the event. This is stable and does not change between game versions, unlike :meth:`SpaceCenter.PartEvent.getGuiName`. :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getGuiName() The name of the event, as displayed in the right-click menu of the part. :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getVisible() Whether the event is visible in the right-click menu of the part, in the current scene (flight or editor). :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getActive() Whether the event is currently active. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: trigger() Trigger the event. Equivalent to clicking the button in the right-click menu of the part. .. class:: PartAction An action of a part module. These are the part actions that can be assigned to action groups in the in-game editor. Obtained by calling :meth:`SpaceCenter.Module.getActionList`. .. method:: getModule() The part module that contains this action. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Module` .. method:: getName() The identifier of the action. This is stable and does not change between game versions, unlike :meth:`SpaceCenter.PartAction.getGuiName`. :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getGuiName() The name of the action, as displayed in the in-game editor. :Property: Read-only, cannot be set :rtype: ``string`` .. method:: setActivated(value) Activate or deactivate the action. Equivalent to triggering the action from an action group. Set to ``true`` to activate the action, or ``false`` to deactivate it. :Property: Write-only, cannot be read :rtype: ``boolean`` Config Node ----------- .. class:: ConfigNode Represents a configuration node, as found in a part's configuration file. A node has a name, a set of named values and a set of child nodes. This is used to access the static configuration of a part or part module, for example via :meth:`SpaceCenter.Part.getConfig` and :meth:`SpaceCenter.Module.getConfig`. .. method:: getName() The name of the configuration node. For example "MODULE". :Property: Read-only, cannot be set :rtype: ``string`` .. method:: getValues() The values stored in the node, as a dictionary mapping names to values. :Property: Read-only, cannot be set :rtype: ``Map`` from ``string`` to ``string`` .. note:: If a name appears more than once, only the first value is included. Use :meth:`SpaceCenter.ConfigNode.findValues` to get all of the values with a given name. .. method:: hasValue(name) Returns ``true`` if the node has a value with the given name. :param name: Name of the value. :type name: ``string`` :rtype: ``boolean`` .. method:: getValue(name) Returns the value with the given name. If there is more than one value with the given name, the first is returned. Throws an exception if there is no value with the given name. :param name: Name of the value. :type name: ``string`` :rtype: ``string`` .. method:: findValues(name) Returns all of the values with the given name, as a list. :param name: Name of the values. :type name: ``string`` :rtype: ``Array`` of ``string`` .. method:: getNodes() The child nodes contained in this node. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ConfigNode` .. method:: hasNode(name) Returns ``true`` if the node has a child node with the given name. :param name: Name of the child node. :type name: ``string`` :rtype: ``boolean`` .. method:: getNode(name) Returns the child node with the given name. If there is more than one child node with the given name, the first is returned. Throws an exception if there is no child node with the given name. :param name: Name of the child node. :type name: ``string`` :rtype: :class:`SpaceCenter.ConfigNode` .. method:: findNodes(name) Returns all of the child nodes with the given name, as a list. :param name: Name of the child nodes. :type name: ``string`` :rtype: ``Array`` of :class:`SpaceCenter.ConfigNode` Specific Types of Part ---------------------- The following classes provide functionality for specific types of part. .. contents:: :local: Antenna ^^^^^^^ .. note:: If RemoteTech is installed, use the RemoteTech service APIs to interact with antennas. This class covers stock and RealAntennas antennas. .. class:: Antenna An antenna. Obtained by calling :meth:`SpaceCenter.Part.getAntenna`. .. method:: getPart() The part object for this antenna. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getState() The current state of the antenna. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` :Game Scenes: Flight .. method:: getDeployable() Whether the antenna is deployable. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployed() setDeployed(value) Whether the antenna is deployed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. note:: Fixed antennas are always deployed. Throws :class:`KRPC.InvalidOperationException` if set on a fixed antenna. .. method:: getCanTransmit() Whether data can be transmitted by this antenna. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: transmit() Transmit data. :Game Scenes: Flight .. method:: cancel() Cancel current transmission of data. :Game Scenes: Flight .. method:: getAllowPartial() setAllowPartial(value) Whether partial data transmission is permitted. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getPower() The power of the antenna. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Not used by RealAntennas, which replaces the stock range model. .. method:: getCombinable() Whether the antenna can be combined with other antennae on the vessel to boost the power. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Not used by RealAntennas, which replaces the stock range model. .. method:: getCombinableExponent() Exponent used to calculate the combined power of multiple antennae on a vessel. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Not used by RealAntennas, which replaces the stock range model. .. method:: getPacketInterval() Interval between sending packets in seconds. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPacketSize() Amount of data sent per packet in Mits. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPacketResourceCost() Units of electric charge consumed per packet sent. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGain() The gain of the antenna, in :math:`\mathrm{dBi}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getTransmitPower() setTransmitPower(value) Returns the transmit power of the antenna, in :math:`\mathrm{dBm}`, and sets it in the editor. Throws an exception if set in flight, or outside zero to :meth:`SpaceCenter.Antenna.getMaxTransmitPower`. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getMaxTransmitPower() The largest transmit power the antenna can be set to, in :math:`\mathrm{dBm}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getTechLevel() setTechLevel(value) Returns the tech level of the antenna, and sets it in the editor. Throws an exception if set in flight, or outside zero to :meth:`SpaceCenter.Antenna.getMaxTechLevel`. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getMaxTechLevel() The highest tech level the antenna can be set to. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getBand() The name of the radio frequency band the antenna uses, e.g. ``"S"``. :Property: Read-only, cannot be set :rtype: ``string`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getFrequency() The frequency of the antenna's band, in Hz. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getDataRate() The highest data rate the antenna supports, in bits per second. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getBeamwidth() The half-power beamwidth of the antenna, in degrees. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getIdlePowerDraw() The power the antenna draws while idle, in watts. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getActivePowerDraw() The power the antenna draws while transmitting, in watts. This includes :meth:`SpaceCenter.Antenna.getIdlePowerDraw`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. .. method:: getEnabled() setEnabled(value) Returns whether the antenna is enabled, and sets it in the editor. Throws an exception if set in flight. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealAntennas. A disabled antenna does not communicate and draws no power. .. method:: disablePermanently() Disable the antenna for the rest of the flight. It then draws no power. :Game Scenes: Flight .. note:: Requires RealAntennas. .. method:: getCanTarget() Whether the antenna can be pointed at a target. Omnidirectional antennas cannot. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. note:: Requires RealAntennas. .. method:: getTargetMode() The kind of target the antenna points at. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AntennaTargetMode` :Game Scenes: Flight .. note:: Requires RealAntennas. .. method:: getTargetVessel() setTargetVessel(value) Returns the vessel the antenna points at, and sets the vessel to point at. :Property: Can be read or written :rtype: :class:`SpaceCenter.Vessel` or ``null`` :Game Scenes: Flight .. note:: Requires RealAntennas. ``null`` if the antenna does not point at a vessel. Throws an exception if set to ``null``, or if the antenna cannot be pointed (see :meth:`SpaceCenter.Antenna.getCanTarget`). .. method:: getTargetBody() setTargetBody(value) Returns the body the antenna points at, and sets the body to point at the center of. :Property: Can be read or written :rtype: :class:`SpaceCenter.CelestialBody` or ``null`` :Game Scenes: Flight .. note:: Requires RealAntennas. Also the body of a position the antenna points at, or ``null`` if it points at neither. Throws an exception if set to ``null``, or if the antenna cannot be pointed (see :meth:`SpaceCenter.Antenna.getCanTarget`). .. method:: targetDirection(referenceFrame) The direction the antenna points in, in the given reference frame. Throws an exception if the antenna has no target (see :meth:`SpaceCenter.Antenna.getTargetMode`). :param referenceFrame: The reference frame that the returned direction is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The direction as a unit vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: Requires RealAntennas. .. method:: setTargetPosition(body, latitude, longitude, altitude) Point the antenna at a position on or above a body. :param body: The body. :type body: :class:`SpaceCenter.CelestialBody` :param latitude: The latitude, in degrees. :type latitude: ``number`` :param longitude: The longitude, in degrees. :type longitude: ``number`` :param altitude: The altitude above sea level, in meters. :type altitude: ``number`` :Game Scenes: Flight .. note:: Requires RealAntennas. Throws an exception if the antenna cannot be pointed (see :meth:`SpaceCenter.Antenna.getCanTarget`). .. method:: setTargetAzimuthElevation(azimuth, elevation) Point the antenna in a direction relative to the vessel's position on the surface. :param azimuth: The azimuth, in degrees clockwise from north, from 0 to 360. :type azimuth: ``number`` :param elevation: The elevation above the horizon, in degrees, from -90 to 90. :type elevation: ``number`` :Game Scenes: Flight .. note:: Requires RealAntennas. Throws an exception if the antenna cannot be pointed (see :meth:`SpaceCenter.Antenna.getCanTarget`). .. method:: setTargetOrbitRelative(deflection, elevation) Point the antenna in a direction relative to the vessel's orbital velocity. :param deflection: The angle from the orbital velocity in the orbital plane, in degrees, from -180 to 180. :type deflection: ``number`` :param elevation: The angle out of the orbital plane, in degrees, from -90 to 90. :type elevation: ``number`` :Game Scenes: Flight .. note:: Requires RealAntennas. Throws an exception if the antenna cannot be pointed (see :meth:`SpaceCenter.Antenna.getCanTarget`). .. class:: AntennaTargetMode The kind of target a RealAntennas antenna points at. See :meth:`SpaceCenter.Antenna.getTargetMode`. .. attribute:: none The antenna has no target. Omnidirectional antennas have none. .. attribute:: vessel A vessel. See :meth:`SpaceCenter.Antenna.getTargetVessel`. .. attribute:: body The center of a body. See :meth:`SpaceCenter.Antenna.getTargetBody`. .. attribute:: position A position on or above a body. See :meth:`SpaceCenter.Antenna.setTargetPosition`. .. attribute:: azimuthElevation An azimuth and elevation from the vessel's position. See :meth:`SpaceCenter.Antenna.setTargetAzimuthElevation`. .. attribute:: orbitRelative A direction relative to the vessel's orbital velocity. See :meth:`SpaceCenter.Antenna.setTargetOrbitRelative`. Cargo Bay ^^^^^^^^^ .. class:: CargoBay A cargo bay. Obtained by calling :meth:`SpaceCenter.Part.getCargoBay`. .. method:: getPart() The part object for this cargo bay. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getState() The state of the cargo bay. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` :Game Scenes: Flight .. note:: This describes where the bay's doors are, which is not the same as whether the parts inside are sheltered: a bay whose open end has nothing attached to it never shelters anything, however tightly shut it is. Use :meth:`SpaceCenter.Part.getShielded` for that. A cargo bay is never :attr:`SpaceCenter.DeployableState.broken`, as the game does not track damage for them. .. method:: getOpen() setOpen(value) Whether the cargo bay is open. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight Control Surface ^^^^^^^^^^^^^^^ .. class:: ControlSurface An aerodynamic control surface. Obtained by calling :meth:`SpaceCenter.Part.getControlSurface`. .. method:: getPart() The part object for this control surface. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPitchEnabled() setPitchEnabled(value) Whether the control surface has pitch control enabled. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getYawEnabled() setYawEnabled(value) Whether the control surface has yaw control enabled. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getRollEnabled() setRollEnabled(value) Whether the control surface has roll control enabled. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getAuthorityLimiter() setAuthorityLimiter(value) The authority limiter for the control surface, which controls how far the control surface will move. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getInverted() setInverted(value) Whether the control surface movement is inverted. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployed() setDeployed(value) Whether the control surface has been fully deployed. Throws an exception if set while :meth:`SpaceCenter.ControlSurface.getDeflectionOverride` is enabled, which holds the surface deployed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployAngle() setDeployAngle(value) The deploy angle of the control surface, in degrees. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Applied when :meth:`SpaceCenter.ControlSurface.getDeployed` is true, and clamped to the range given by :meth:`SpaceCenter.ControlSurface.getMinDeployAngle` and :meth:`SpaceCenter.ControlSurface.getMaxDeployAngle`. While :meth:`SpaceCenter.ControlSurface.getDeflectionOverride` is enabled, :meth:`SpaceCenter.ControlSurface.getDeflection` drives the angle. A value set here takes effect when the override is released. .. method:: getMinDeployAngle() The minimum :meth:`SpaceCenter.ControlSurface.getDeployAngle` of the control surface, in degrees. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getMaxDeployAngle() The maximum :meth:`SpaceCenter.ControlSurface.getDeployAngle` of the control surface, in degrees. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeflectionOverride() setDeflectionOverride(value) Whether the control surface deflection is being set directly, bypassing the vessel's normal flight control. When enabled, the surface holds the deflection set by :meth:`SpaceCenter.ControlSurface.getDeflection` instead of responding to pitch, yaw and roll control inputs. The prior state is restored when the override is released, when the controlling client disconnects, or when the vessel changes. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getDeflection() setDeflection(value) The deflection command applied when :meth:`SpaceCenter.ControlSurface.getDeflectionOverride` is enabled, as a value between -1 and 1, mapped onto the surface's deploy angle range. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getDeflectionAngle() The current angle of the control surface from its neutral position, in degrees. Includes the :meth:`SpaceCenter.ControlSurface.getDeployAngle` while the surface is deployed. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getControlRange() The angle the control surface deflects by for a full control input, in degrees, before the :meth:`SpaceCenter.ControlSurface.getAuthorityLimiter` is applied. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getActuatorSpeed() The rate the control surface deflects at, in degrees per second. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getSurfaceArea() Surface area of the control surface in :math:`\mathrm{m^{2}}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getAvailableTorque() The available torque, in :math:`\mathrm{N \cdot m}`, that can be produced by this control surface, in the positive and negative pitch, roll and yaw axes of the vessel. These axes correspond to the coordinate axes of the :meth:`SpaceCenter.Vessel.getReferenceFrame`. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AxisRange` :Game Scenes: Flight Decoupler ^^^^^^^^^ .. class:: Decoupler A decoupler. Obtained by calling :meth:`SpaceCenter.Part.getDecoupler` .. method:: getPart() The part object for this decoupler. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: decouple() Fires the decoupler. Returns the new vessel created when the decoupler fires. Throws an exception if the decoupler has already fired. :rtype: :class:`SpaceCenter.Vessel` :Game Scenes: Flight .. note:: When called, the active vessel may change. It is therefore possible that, after calling this function, the object(s) returned by previous call(s) to :func:`SpaceCenter.getActiveVessel` no longer refer to the active vessel. .. method:: getDecoupled() Whether the decoupler has fired. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getStaged() Whether the decoupler is enabled in the staging sequence. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getImpulse() The impulse that the decoupler imparts when it is fired, in :math:`\mathrm{N \cdot s}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getIsOmniDecoupler() Whether the decoupler is an omni-decoupler (e.g. stack separator) :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getAttachedPart() The part attached to this decoupler's explosive node. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` or ``null`` :Game Scenes: Flight, Editor Vab, Editor Sph Deployable State ^^^^^^^^^^^^^^^^ The deployment state shared by antennas, cargo bays, landing legs, radiators, resource harvesters, solar panels and wheels. .. class:: DeployableState The state of a deployable part. :meth:`SpaceCenter.Antenna.getState`, :meth:`SpaceCenter.CargoBay.getState`, :meth:`SpaceCenter.Leg.getState`, :meth:`SpaceCenter.Radiator.getState`, :meth:`SpaceCenter.ResourceHarvester.getState`, :meth:`SpaceCenter.SolarPanel.getState`, :meth:`SpaceCenter.Wheel.getState` .. attribute:: deployed The part is fully deployed. A cargo bay in this state is fully open. Parts that cannot be retracted, such as fixed radiators, solar panels, antennas, landing legs and wheels, are always in this state. .. attribute:: retracted The part is fully retracted. A cargo bay in this state is closed and locked. .. attribute:: deploying The part is being deployed. A cargo bay in this state is opening. .. attribute:: retracting The part is being retracted. A cargo bay in this state is closing. .. attribute:: broken The part is broken. Cargo bays and resource harvesters never report this state, as the game does not track damage for them. Docking Port ^^^^^^^^^^^^ .. class:: DockingPort A docking port. Obtained by calling :meth:`SpaceCenter.Part.getDockingPort` .. method:: getPart() The part object for this docking port. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getState() The current state of the docking port. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DockingPortState` :Game Scenes: Flight .. method:: getDockedPart() The part that this docking port is docked to. Returns ``null`` if this docking port is not docked to anything. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` or ``null`` :Game Scenes: Flight .. method:: undock() Undocks the docking port and returns the new :class:`SpaceCenter.Vessel` that is created. This method can be called for either docking port in a docked pair. Throws an exception if the docking port is not docked to anything. :rtype: :class:`SpaceCenter.Vessel` :Game Scenes: Flight .. note:: When called, the active vessel may change. It is therefore possible that, after calling this function, the object(s) returned by previous call(s) to :func:`SpaceCenter.getActiveVessel` no longer refer to the active vessel. .. method:: getReengageDistance() The distance a docking port must move away when it undocks before it becomes ready to dock with another port, in meters. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getHasShield() Whether the docking port has a shield. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getShielded() setShielded(value) The state of the docking ports shield, if it has one. Returns ``true`` if the docking port has a shield, and the shield is closed. Otherwise returns ``false``. When set to ``true``, the shield is closed, and when set to ``false`` the shield is opened. If the docking port does not have a shield, setting this attribute has no effect. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getCanRotate() Whether the docking port can be commanded to rotate while docked. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getMaximumRotation() Maximum rotation angle in degrees. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMinimumRotation() Minimum rotation angle in degrees. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getRotationTarget() setRotationTarget(value) Rotation target angle in degrees. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getRotationLocked() setRotationLocked(value) Lock rotation. When locked, allows auto-strut to work across the joint. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: position(referenceFrame) The position of the docking port, in the given reference frame. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: direction(referenceFrame) The direction that docking port points in, in the given reference frame. :param referenceFrame: The reference frame that the returned direction is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The direction as a unit vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: rotation(referenceFrame) The rotation of the docking port, in the given reference frame. :param referenceFrame: The reference frame that the returned rotation is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The rotation as a quaternion of the form ``(x, y, z, w)``. :rtype: ``[number, number, number, number]`` :Game Scenes: Flight .. method:: getReferenceFrame() The reference frame that is fixed relative to this docking port, and oriented with the port. * The origin is at the position of the docking port. * The axes rotate with the docking port. * The x-axis points out to the right side of the docking port. * The y-axis points in the direction the docking port is facing. * The z-axis points out of the bottom off the docking port. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ReferenceFrame` :Game Scenes: Flight .. note:: This reference frame is not necessarily equivalent to the reference frame for the part, returned by :meth:`SpaceCenter.Part.getReferenceFrame`. .. figure:: /images/reference-frames/docking-port.png :align: center Docking port reference frame origin and axes .. figure:: /images/reference-frames/docking-port-inline.png :align: center Inline docking port reference frame origin and axes .. class:: DockingPortState The state of a docking port. See :meth:`SpaceCenter.DockingPort.getState`. .. attribute:: ready The docking port is ready to dock to another docking port. .. attribute:: docked The docking port is docked to another docking port, or docked to another part (from the VAB/SPH). .. attribute:: docking The docking port is very close to another docking port, but has not docked. It is using magnetic force to acquire a solid dock. .. attribute:: undocking The docking port has just been undocked from another docking port, and is disabled until it moves away by a sufficient distance (:meth:`SpaceCenter.DockingPort.getReengageDistance`). .. attribute:: shielded The docking port has a shield, and the shield is closed. .. attribute:: moving The docking ports shield is currently opening/closing. Engine ^^^^^^ .. class:: Engine An engine, including ones of various types. For example liquid fuelled gimballed engines, solid rocket boosters and jet engines. Obtained by calling :meth:`SpaceCenter.Part.getEngine`. .. note:: For RCS thrusters :meth:`SpaceCenter.Part.getRCS`. .. method:: getPart() The part object for this engine. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getActive() setActive(value) Whether the engine is active. Setting this attribute may have no effect, depending on :meth:`SpaceCenter.Engine.getCanShutdown` and :meth:`SpaceCenter.Engine.getCanRestart`. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getThrust() The current amount of thrust being produced by the engine, in Newtons. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getAvailableThrust() The amount of thrust, in Newtons, that would be produced by the engine when activated and with its throttle set to 100%. Returns zero if the engine does not have any fuel. Takes the engine's current :meth:`SpaceCenter.Engine.getThrustLimit` and atmospheric conditions into account. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: availableThrustAt(pressure) The amount of thrust, in Newtons, that would be produced by the engine when activated and with its throttle set to 100%. Returns zero if the engine does not have any fuel. Takes the given pressure into account. :param pressure: Atmospheric pressure in atmospheres :type pressure: ``number`` :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxThrust() The amount of thrust, in Newtons, that would be produced by the engine when activated and fueled, with its throttle and throttle limiter set to 100%. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: maxThrustAt(pressure) The amount of thrust, in Newtons, that would be produced by the engine when activated and fueled, with its throttle and throttle limiter set to 100%. Takes the given pressure into account. :param pressure: Atmospheric pressure in atmospheres :type pressure: ``number`` :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getMaxVacuumThrust() The maximum amount of thrust that can be produced by the engine in a vacuum, in Newtons. This is the amount of thrust produced by the engine when activated, :meth:`SpaceCenter.Engine.getThrustLimit` is set to 100%, the main vessel's throttle is set to 100% and the engine is in a vacuum. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getThrustLimit() setThrustLimit(value) The thrust limiter of the engine. A value between 0 and 1. Setting this attribute may have no effect, for example the thrust limit for a solid rocket booster cannot be changed in flight. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getThrusters() The components of the engine that generate thrust. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Thruster` :Game Scenes: Flight .. note:: For example, this corresponds to the rocket nozzel on a solid rocket booster, or the individual nozzels on a RAPIER engine. The overall thrust produced by the engine, as reported by :meth:`SpaceCenter.Engine.getAvailableThrust`, :meth:`SpaceCenter.Engine.getMaxThrust` and others, is the sum of the thrust generated by each thruster. .. method:: getSpecificImpulse() The current specific impulse of the engine, in seconds. Returns zero if the engine is not active. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: specificImpulseAt(pressure) The specific impulse of the engine under the given pressure, in seconds. Returns zero if the engine is not active. :param pressure: Atmospheric pressure in atmospheres :type pressure: ``number`` :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getVacuumSpecificImpulse() The vacuum specific impulse of the engine, in seconds. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getKerbinSeaLevelSpecificImpulse() The specific impulse of the engine at sea level on Kerbin, in seconds. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPropellantNames() The names of the propellants that the engine consumes. :Property: Read-only, cannot be set :rtype: ``Array`` of ``string`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPropellantRatios() The ratio of resources that the engine consumes. A dictionary mapping resource names to the ratio at which they are consumed by the engine. :Property: Read-only, cannot be set :rtype: ``Map`` from ``string`` to ``number`` :Game Scenes: Flight .. note:: For example, if the ratios are 0.6 for LiquidFuel and 0.4 for Oxidizer, then for every 0.6 units of LiquidFuel that the engine burns, it will burn 0.4 units of Oxidizer. .. method:: getPropellants() The propellants that the engine consumes. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Propellant` :Game Scenes: Flight .. method:: getHasFuel() Whether the engine has any fuel available. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getFlameout() Whether the engine has flamed out - it is active but has run out of propellant, so it is producing no thrust. This is the signal a client can use to decide when to activate the next stage. Note that on a vessel with drop tanks or asparagus staging some engines can flame out while others keep burning. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getThrottle() setThrottle(value) The current throttle setting for the engine. A value between 0 and 1. This is not necessarily the same as the vessel's main throttle setting, as some engines take time to adjust their throttle (such as jet engines), or independent throttle may be enabled. When the engine's independent throttle is enabled (see :meth:`SpaceCenter.Engine.getIndependentThrottle`), can be used to set the throttle percentage. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getThrottleLocked() Whether the :meth:`SpaceCenter.Control.getThrottle` affects the engine. For example, this is ``true`` for liquid fueled rockets, and ``false`` for solid rocket boosters. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getIndependentThrottle() setIndependentThrottle(value) Whether the independent throttle is enabled for the engine. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getCanRestart() Whether the engine can be restarted once shutdown. If the engine cannot be shutdown, returns ``false``. For example, this is ``true`` for liquid fueled rockets and ``false`` for solid rocket boosters. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getCanShutdown() Whether the engine can be shutdown once activated. For example, this is ``true`` for liquid fueled rockets and ``false`` for solid rocket boosters. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getHasModes() Whether the engine has multiple modes of operation. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getMode() setMode(value) The name of the current engine mode. :Property: Can be read or written :rtype: ``string`` :Game Scenes: Flight .. method:: getModes() The available modes for the engine. A dictionary mapping mode names to :class:`SpaceCenter.Engine` objects. :Property: Read-only, cannot be set :rtype: ``Map`` from ``string`` to :class:`SpaceCenter.Engine` :Game Scenes: Flight .. method:: toggleMode() Toggle the current engine mode. :Game Scenes: Flight .. method:: getAutoModeSwitch() setAutoModeSwitch(value) Whether the engine will automatically switch modes. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getGimballed() Whether the engine is gimballed. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalRange() The range over which the gimbal can move, in degrees. Returns 0 if the engine is not gimballed. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalLocked() setGimbalLocked(value) Whether the engines gimbal is locked in place. Setting this attribute has no effect if the engine is not gimballed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalLimit() setGimbalLimit(value) The gimbal limiter of the engine. A value between 0 and 1. Returns 0 if the gimbal is locked. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalResponseSpeedEnabled() Whether the gimbal moves toward its commanded deflection at :meth:`SpaceCenter.Engine.getGimbalResponseSpeed`. When ``false``, the gimbal reaches its commanded deflection in one physics tick. Throws an exception if the engine is not gimballed. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalResponseSpeed() The response speed of the gimbal, in :math:`\mathrm{s^{-1}}`. Throws an exception if the engine is not gimballed. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Each physics tick of length :math:`\Delta t`, the gimbal moves a fraction :math:`v \Delta t` of the way from its deflection to the commanded deflection, where :math:`v` is the response speed. The fraction is at most 1, so at high physics warp the gimbal can reach its commanded deflection in one tick. This lag only applies when :meth:`SpaceCenter.Engine.getGimbalResponseSpeedEnabled` is ``true``. .. method:: getGimbalPitchEnabled() setGimbalPitchEnabled(value) Whether the gimbal responds to pitch control input. Throws an exception if the engine is not gimballed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalYawEnabled() setGimbalYawEnabled(value) Whether the gimbal responds to yaw control input. Throws an exception if the engine is not gimballed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalRollEnabled() setGimbalRollEnabled(value) Whether the gimbal responds to roll control input. Throws an exception if the engine is not gimballed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getGimbalOverride() setGimbalOverride(value) Whether the gimbal is being controlled directly, bypassing the vessel's normal flight controls. When enabled, the gimbal deflection is set by :meth:`SpaceCenter.Engine.getGimbalActuation` instead of the normal control inputs. The override is automatically released if the controlling client disconnects or the vessel changes. Has no effect if the engine is not gimballed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getGimbalActuation() setGimbalActuation(value) The gimbal actuation command applied when :meth:`SpaceCenter.Engine.getGimbalOverride` is enabled, in the pitch, roll and yaw axes. Each component is a normalized control input between -1 and 1. The physical deflection is scaled by :meth:`SpaceCenter.Engine.getGimbalRange` and :meth:`SpaceCenter.Engine.getGimbalLimit`. When the gimbal is not being overridden, returns the current actuation. :Property: Can be read or written :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: The gimbal ignores the component for an axis it is disabled for, such as pitch when :meth:`SpaceCenter.Engine.getGimbalPitchEnabled` is ``false``. .. method:: getAvailableTorque() The available torque, in :math:`\mathrm{N \cdot m}`, that can be produced by this engine, in the positive and negative pitch, roll and yaw axes of the vessel. These axes correspond to the coordinate axes of the :meth:`SpaceCenter.Vessel.getReferenceFrame`. Returns zero if the engine is inactive, or not gimballed. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AxisRange` :Game Scenes: Flight .. note:: The torque is zero about an axis the gimbal is disabled for, such as pitch when :meth:`SpaceCenter.Engine.getGimbalPitchEnabled` is ``false``. .. method:: getCanReverseThrust() Whether the engine has a recognized thrust reverser. This is ``true`` for stock engines with a thrust reverser (such as the J-33 "Wheesley" and J-90 "Goliath" turbofan engines) and for supported mod engines. It is ``false`` for engines whose reverser is not recognized, as KSP provides no standard way to detect one. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Recognizes the thrust reversers of Firespitter and KerbalActuators. .. method:: getThrustReversed() setThrustReversed(value) Whether the engine's thrust reverser is engaged, reversing the direction of thrust. While the reverser is still moving, this reports the state it is moving to, so a read immediately after a set returns the value that was set and setting the same value again has no effect. Throws an exception if the engine does not have a thrust reverser (see :meth:`SpaceCenter.Engine.getCanReverseThrust`). :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: toggleThrustReversal() Toggle the engine's thrust reverser. Throws an exception if the engine does not have a thrust reverser (see :meth:`SpaceCenter.Engine.getCanReverseThrust`). :Game Scenes: Flight .. method:: getHasRealFuels() Whether the engine is managed by RealFuels. The remaining properties in this section are only available when it is. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getIgnitions() The number of times the engine can still be ignited, or -1 if it can be ignited an unlimited number of times. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealFuels. .. method:: getIgnitionResources() The resources the engine consumes each time it ignites, keyed by resource name, with the amount of each that is required. The engine uses up an ignition and fails to light if they are not available. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``Map`` from ``string`` to ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealFuels. .. method:: getHasUllage() Whether the engine's propellant is subject to ullage, so that it must be settled before the engine will run reliably. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealFuels. .. method:: getPropellantStability() How settled the propellant feeding the engine is, from 0 (fully unsettled) to 1 (fully settled). Acceleration along the engine's thrust axis settles it, and coasting and rotation unsettle it. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: Requires RealFuels. .. method:: getPropellantReliability() The probability that the propellant feeding the engine behaves normally, from 0 to 1. This is :meth:`SpaceCenter.Engine.getPropellantStability` scaled by the game's ullage difficulty setting, and is the value RealFuels itself tests against when deciding whether the engine runs. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: Requires RealFuels. .. method:: getPressureFed() Whether the engine is fed by tank pressure rather than by a pump, and so needs to draw from a highly pressurized tank. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: Requires RealFuels. .. method:: getHasFeedPressure() Whether the tanks feeding the engine supply the pressure it needs. Always ``true`` for an engine that is not pressure fed. Throws an exception if the engine is not managed by RealFuels (see :meth:`SpaceCenter.Engine.getHasRealFuels`). :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. note:: Requires RealFuels. .. class:: Propellant A propellant for an engine. Obtains by calling :meth:`SpaceCenter.Engine.getPropellants`. .. method:: getName() The name of the propellant. :Property: Read-only, cannot be set :rtype: ``string`` :Game Scenes: Flight .. method:: getCurrentAmount() The current amount of propellant consumed in the current physics update. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getCurrentRequirement() The required amount of propellant for the current physics update. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getTotalResourceAvailable() The total amount of the underlying resource currently reachable given resource flow rules. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getTotalResourceCapacity() The total vehicle capacity for the underlying propellant resource, restricted by resource flow rules. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getIgnoreForIsp() If this propellant should be ignored when calculating required mass flow given specific impulse. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getIgnoreForThrustCurve() If this propellant should be ignored for thrust curve calculations. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getDrawStackGauge() If this propellant has a stack gauge or not. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getIsDeprived() If this propellant is deprived. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getRatio() The propellant ratio. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight Experiment ^^^^^^^^^^ .. class:: Experiment Obtained by calling :meth:`SpaceCenter.Part.getExperiment`. .. note:: Includes the experiments of DMagic's DMModuleScienceAnimateGeneric. .. method:: getPart() The part object for this experiment. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getName() Internal name of the experiment, as used in `part cfg files `_. :Property: Read-only, cannot be set :rtype: ``string`` :Game Scenes: Flight .. method:: getTitle() Title of the experiment, as shown on the in-game UI. :Property: Read-only, cannot be set :rtype: ``string`` :Game Scenes: Flight .. method:: run() Run the experiment. :Game Scenes: Flight .. method:: transmit() Transmit all experimental data contained by this part. :Game Scenes: Flight .. method:: dump() Dump the experimental data contained by the experiment. :Game Scenes: Flight .. method:: reset() Reset the experiment. :Game Scenes: Flight .. method:: getDeployed() Whether the experiment has been deployed. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getRerunnable() Whether the experiment can be re-run. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getInoperable() Whether the experiment is inoperable. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getHasData() Whether the experiment contains data. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getData() The data contained in this experiment. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.ScienceData` :Game Scenes: Flight .. method:: getBiome() The name of the biome the experiment is currently in. :Property: Read-only, cannot be set :rtype: ``string`` :Game Scenes: Flight .. method:: getAvailable() Determines if the experiment is available given the current conditions. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getScienceSubject() Containing information on the corresponding specific science result for the current conditions. Returns ``null`` if the experiment is unavailable. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ScienceSubject` or ``null`` :Game Scenes: Flight .. class:: ScienceData(fields) Obtained by calling :meth:`SpaceCenter.Experiment.getData`. .. attribute:: dataAmount Data amount. :Type: ``number`` .. attribute:: scienceValue Science value. :Type: ``number`` .. attribute:: transmitValue Transmit value. :Type: ``number`` .. class:: ScienceSubject(fields) Obtained by calling :meth:`SpaceCenter.Experiment.getScienceSubject`. .. attribute:: id The identifier of the subject, e.g. ``crewReport@KerbinSrfLandedLaunchPad``. :Type: ``string`` .. attribute:: title The title of the subject, as shown in the science archives. :Type: ``string`` .. attribute:: isComplete Whether the subject has been fully researched. This is true once the science banked for the subject reaches the science cap. As the banked science (see :attr:`SpaceCenter.ScienceSubject.science`) is only updated after transmission/recovery, this reflects fully mining the subject over repeated experiments, not whether a single run has produced data. To check whether a run has produced data, and how valuable it is, use :meth:`SpaceCenter.Experiment.getHasData` and :attr:`SpaceCenter.ScienceData.transmitValue`. :Type: ``boolean`` .. attribute:: science Amount of science already earned from this subject, not updated until after transmission/recovery. :Type: ``number`` .. attribute:: scienceCap Total science allowable for this subject. :Type: ``number`` .. attribute:: dataScale Multiply science value by this to determine data amount in mits. :Type: ``number`` .. attribute:: subjectValue Multiplier for specific Celestial Body/Experiment Situation combination. :Type: ``number`` .. attribute:: scientificValue Diminishing value multiplier for decreasing the science value returned from repeated experiments. :Type: ``number`` Fairing ^^^^^^^ .. class:: Fairing A fairing. Obtained by calling :meth:`SpaceCenter.Part.getFairing`. .. note:: Includes the fairings of ProceduralFairings. .. method:: getPart() The part object for this fairing. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: jettison() Jettison the fairing. Has no effect if it has already been jettisoned. :Game Scenes: Flight .. method:: getJettisoned() Whether the fairing has been jettisoned. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight Intake ^^^^^^ .. class:: Intake An air intake. Obtained by calling :meth:`SpaceCenter.Part.getIntake`. .. method:: getPart() The part object for this intake. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getOpen() setOpen(value) Whether the intake is open. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getSpeed() Speed of the flow into the intake, in :math:`\mathrm{m/s}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getFlow() The rate of flow into the intake, in units of resource per second. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getArea() The area of the intake's opening, in :math:`\mathrm{m^{2}}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph Leg ^^^ .. class:: Leg A landing leg. Obtained by calling :meth:`SpaceCenter.Part.getLeg`. .. method:: getPart() The part object for this landing leg. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getState() The current state of the landing leg. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` :Game Scenes: Flight .. method:: getDeployable() Whether the leg is deployable. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployed() setDeployed(value) Whether the landing leg is deployed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. note:: Fixed landing legs are always deployed. Throws :class:`KRPC.InvalidOperationException` if set on a fixed landing leg. .. method:: getIsGrounded() Returns whether the leg is touching the ground. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getLoad() The force pressing the leg's foot into the ground, in :math:`\mathrm{kN}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The game raises the load of a grounded leg to at least 10 kN. :meth:`SpaceCenter.Leg.getImpactTolerance` applies to the rise in this value. .. method:: contactPosition(referenceFrame) The position of the bottom of the leg's foot, in the given reference frame. While the leg is grounded, this is where it touches the ground. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getSuspensionSpringStrength() Suspension spring strength, as set in the editor. Throws an exception if the leg has no suspension. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getSuspensionDamperStrength() Suspension damper strength, as set in the editor. Throws an exception if the leg has no suspension. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getSuspensionSpring() The spring constant of the suspension, in :math:`\mathrm{kN/m}`, or ``null`` while the leg is not grounded. :Property: Read-only, cannot be set :rtype: ``number`` or ``null`` :Game Scenes: Flight .. note:: The game updates it while the leg is grounded, from :meth:`SpaceCenter.Leg.getSuspensionSpringStrength`, the vessel's mass, the leg's compression and the local gravity. .. method:: getSuspensionDamper() The damping constant of the suspension, in :math:`\mathrm{kN \cdot s/m}`, or ``null`` while the leg is not grounded. :Property: Read-only, cannot be set :rtype: ``number`` or ``null`` :Game Scenes: Flight .. note:: The game updates it while the leg is grounded, from :meth:`SpaceCenter.Leg.getSuspensionDamperStrength` and :meth:`SpaceCenter.Leg.getSuspensionSpring`. .. method:: getSuspensionTravel() The travel of the suspension, in meters. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getImpactTolerance() The rise in :meth:`SpaceCenter.Leg.getLoad` over one physics tick that breaks the leg, in :math:`\mathrm{kN}`. Throws an exception if the leg is not breakable. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. note:: The game scales the rise by the local gravity divided by standard gravity before comparing it with this tolerance. .. method:: getExplodeMultiplier() The multiple of :meth:`SpaceCenter.Leg.getImpactTolerance` that destroys the leg, in place of breaking it. Throws an exception if the leg is not breakable. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph Launch Clamp ^^^^^^^^^^^^ .. class:: LaunchClamp A launch clamp. Obtained by calling :meth:`SpaceCenter.Part.getLaunchClamp`. .. method:: getPart() The part object for this launch clamp. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: release() Releases the docking clamp. Has no effect if the clamp has already been released. :Game Scenes: Flight Light ^^^^^ .. class:: Light A light. Obtained by calling :meth:`SpaceCenter.Part.getLight`. .. method:: getPart() The part object for this light. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getActive() setActive(value) Whether the light is switched on. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getColor() setColor(value) The color of the light. :Property: Can be read or written :rtype: :class:`StdLib.ColorRGB` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getBlink() setBlink(value) Whether blinking is enabled. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getBlinkRate() setBlinkRate(value) The blink rate of the light. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPowerUsage() The current power usage, in units of charge per second. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight Parachute ^^^^^^^^^ .. class:: Parachute A parachute. Obtained by calling :meth:`SpaceCenter.Part.getParachute`. .. note:: Includes the parachutes of RealChute. .. method:: getPart() The part object for this parachute. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: deploy() Deploys the parachute. This has no effect if the parachute has already been deployed. :Game Scenes: Flight .. method:: getDeployed() Whether the parachute has been deployed. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: arm() Deploys the parachute. This has no effect if the parachute has already been armed or deployed. :Game Scenes: Flight .. method:: getArmed() Whether the parachute has been armed or deployed. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: cut() Cuts the parachute. :Game Scenes: Flight .. method:: getState() The current state of the parachute. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ParachuteState` :Game Scenes: Flight .. method:: getDeployAltitude() setDeployAltitude(value) The altitude at which the parachute will full deploy, in meters. Only applicable to stock parachutes. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployMinPressure() setDeployMinPressure(value) The minimum pressure at which the parachute will semi-deploy, in atmospheres. Only applicable to stock parachutes. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getSafeState() Whether it is currently safe to deploy the parachute, given the vessel's flight conditions. Computed by KSP from the current airspeed, pressure and temperature. Only applicable to stock parachutes. Note that KSP reports :attr:`SpaceCenter.ParachuteSafeState.unsafe` for the first second after the vessel unpacks, before its thermal data is valid. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ParachuteSafeState` :Game Scenes: Flight .. class:: ParachuteState The state of a parachute. See :meth:`SpaceCenter.Parachute.getState`. .. attribute:: stowed The parachute is safely tucked away inside its housing. .. attribute:: armed The parachute is armed for deployment. .. attribute:: semiDeployed The parachute has been deployed and is providing some drag, but is not fully deployed yet. (Stock parachutes only) .. attribute:: deployed The parachute is fully deployed. .. attribute:: cut The parachute has been cut. .. class:: ParachuteSafeState The safety state of deploying a parachute. See :meth:`SpaceCenter.Parachute.getSafeState`. .. attribute:: safe The parachute is safe to deploy. .. attribute:: risky Deploying the parachute is risky, and it may break off. .. attribute:: unsafe The parachute is unsafe to deploy, and will break off. .. attribute:: none The safety state is not available, because the vessel is not in an atmosphere or the parachute has already been deployed or cut. Radiator ^^^^^^^^ .. class:: Radiator A radiator. Obtained by calling :meth:`SpaceCenter.Part.getRadiator`. .. method:: getPart() The part object for this radiator. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployable() Whether the radiator is deployable. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployed() setDeployed(value) For a deployable radiator, ``true`` if the radiator is extended. If the radiator is not deployable, this is always ``true``. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getState() The current state of the radiator. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` :Game Scenes: Flight .. note:: A fixed radiator is always :attr:`SpaceCenter.DeployableState.deployed`. Resource Converter ^^^^^^^^^^^^^^^^^^ .. class:: ResourceConverter A resource converter. Obtained by calling :meth:`SpaceCenter.Part.getResourceConverter`. .. method:: getPart() The part object for this converter. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getCount() The number of converters in the part. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: name(index) The name of the specified converter. :param index: Index of the converter. :type index: ``number`` :rtype: ``string`` :Game Scenes: Flight .. method:: active(index) True if the specified converter is active. :param index: Index of the converter. :type index: ``number`` :rtype: ``boolean`` :Game Scenes: Flight .. method:: start(index) Start the specified converter. :param index: Index of the converter. :type index: ``number`` :Game Scenes: Flight .. method:: stop(index) Stop the specified converter. :param index: Index of the converter. :type index: ``number`` :Game Scenes: Flight .. method:: state(index) The state of the specified converter. :param index: Index of the converter. :type index: ``number`` :rtype: :class:`SpaceCenter.ResourceConverterState` :Game Scenes: Flight .. method:: statusInfo(index) Status information for the specified converter. This is the full status message shown in the in-game UI. :param index: Index of the converter. :type index: ``number`` :rtype: ``string`` :Game Scenes: Flight .. method:: inputs(index) List of the names of resources consumed by the specified converter. :param index: Index of the converter. :type index: ``number`` :rtype: ``Array`` of ``string`` :Game Scenes: Flight .. method:: outputs(index) List of the names of resources produced by the specified converter. :param index: Index of the converter. :type index: ``number`` :rtype: ``Array`` of ``string`` :Game Scenes: Flight .. method:: getOptimumCoreTemperature() The core temperature at which the converter will operate with peak efficiency, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getCoreTemperature() The core temperature of the converter, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalEfficiency() The thermal efficiency of the converter, as a percentage of its maximum. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. class:: ResourceConverterState The state of a resource converter. See :meth:`SpaceCenter.ResourceConverter.state`. .. attribute:: running Converter is running. .. attribute:: idle Converter is idle. .. attribute:: missingResource Converter is missing a required resource. .. attribute:: storageFull No available storage for output resource. .. attribute:: capacity At preset resource capacity. .. attribute:: unknown Unknown state. Possible with modified resource converters. In this case, check :meth:`SpaceCenter.ResourceConverter.statusInfo` for more information. Resource Harvester ^^^^^^^^^^^^^^^^^^ .. class:: ResourceHarvester A resource harvester (drill). Obtained by calling :meth:`SpaceCenter.Part.getResourceHarvester`. .. method:: getPart() The part object for this harvester. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getState() The deployment state of the harvester. Whether it is drilling is reported separately by :meth:`SpaceCenter.ResourceHarvester.getActive`. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` :Game Scenes: Flight .. note:: A harvester is never :attr:`SpaceCenter.DeployableState.broken`, as the game does not track damage for them. .. method:: getDeployed() setDeployed(value) Whether the harvester is deployed. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getActive() setActive(value) Whether the harvester is actively drilling. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. note:: A value set while the harvester is deploying is applied when the deploy completes, so it can be set immediately after setting :meth:`SpaceCenter.ResourceHarvester.getDeployed` without waiting for the deploy animation. Setting it has no effect while the harvester is retracted or retracting. .. method:: getExtractionRate() The rate at which the drill is extracting ore, in :math:`\mathrm{units/s}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getThermalEfficiency() The thermal efficiency of the drill, as a percentage of its maximum. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getCoreTemperature() The core temperature of the drill, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getOptimumCoreTemperature() The core temperature at which the drill will operate with peak efficiency, in Kelvin. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight Reaction Wheel ^^^^^^^^^^^^^^ .. class:: ReactionWheel A reaction wheel. Obtained by calling :meth:`SpaceCenter.Part.getReactionWheel`. .. method:: getPart() The part object for this reaction wheel. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getActive() setActive(value) Whether the reaction wheel is active. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getBroken() Whether the reaction wheel is broken. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getAvailableTorque() The available torque, in :math:`\mathrm{N \cdot m}`, that can be produced by this reaction wheel, in the positive and negative pitch, roll and yaw axes of the vessel. These axes correspond to the coordinate axes of the :meth:`SpaceCenter.Vessel.getReferenceFrame`. Returns zero if the reaction wheel is inactive or broken. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AxisRange` :Game Scenes: Flight .. method:: getMaxTorque() The maximum torque, in :math:`\mathrm{N \cdot m}`, that can be produced by this reaction wheel, when it is active, in the positive and negative pitch, roll and yaw axes of the vessel. These axes correspond to the coordinate axes of the :meth:`SpaceCenter.Vessel.getReferenceFrame`. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AxisRange` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getAuthorityLimiter() setAuthorityLimiter(value) The authority limiter for the reaction wheel, as a percentage of maximum torque. A value between 0 and 1. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph Resource Drain ^^^^^^^^^^^^^^ .. class:: ResourceDrain A resource drain. Obtained by calling :meth:`SpaceCenter.Part.getResourceDrain`. .. method:: getPart() The part object for this resource drain. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getAvailableResources() List of available resources. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Resource` :Game Scenes: Flight .. method:: setResource(resource, enabled) Whether the given resource should be drained. :param resource: :type resource: :class:`SpaceCenter.Resource` :param enabled: :type enabled: ``boolean`` :Game Scenes: Flight .. method:: checkResource(resource) Whether the provided resource is enabled for draining. :param resource: :type resource: :class:`SpaceCenter.Resource` :rtype: ``boolean`` :Game Scenes: Flight .. method:: getDrainMode() setDrainMode(value) The drain mode. :Property: Can be read or written :rtype: :class:`SpaceCenter.DrainMode` :Game Scenes: Flight .. method:: getMinRate() Minimum possible drain rate :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxRate() Maximum possible drain rate. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getRate() setRate(value) Current drain rate. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: start() Activates resource draining for all enabled parts. :Game Scenes: Flight .. method:: stop() Turns off resource draining. :Game Scenes: Flight .. class:: DrainMode Resource drain mode. See :meth:`SpaceCenter.ResourceDrain.getDrainMode`. .. attribute:: part Drains from the parent part. .. attribute:: vessel Drains from all available parts. Robotic Controller ^^^^^^^^^^^^^^^^^^ .. class:: RoboticController A robotic controller. Obtained by calling :meth:`SpaceCenter.Part.getRoboticController`. .. method:: getPart() The part object for this controller. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getEnabled() setEnabled(value) Whether the controller is enabled. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getPlaying() Whether the controller's sequence is currently playing. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getPosition() setPosition(value) The current position along the sequence, in seconds. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getLength() The length of the sequence, in seconds. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getPlaySpeed() The speed at which the sequence is played back, as a multiple of normal speed. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: play() Start playing the controller's sequence. :Game Scenes: Flight .. method:: stop() Stop playing the controller's sequence. :Game Scenes: Flight .. method:: hasPart(part) Whether the controller has a part. :param part: :type part: :class:`SpaceCenter.Part` :rtype: ``boolean`` :Game Scenes: Flight .. method:: axes() The axes for the controller. :rtype: ``Array`` of :class:`SpaceCenter.RoboticAxis` :Game Scenes: Flight .. method:: addAxis(module, fieldName) Add an axis to the controller. :param module: The part module that the axis belongs to. :type module: :class:`SpaceCenter.Module` :param fieldName: The name of the axis field, as returned by :meth:`SpaceCenter.RoboticController.axes`. :type fieldName: ``string`` :returns: Returns ``true`` if the axis is added successfully. :rtype: ``boolean`` :Game Scenes: Flight .. method:: addKeyFrame(module, fieldName, time, value) Add key frame value for controller axis. :param module: The part module that the axis belongs to. :type module: :class:`SpaceCenter.Module` :param fieldName: The name of the axis field, as returned by :meth:`SpaceCenter.RoboticController.axes`. :type fieldName: ``string`` :param time: The time of the key frame. :type time: ``number`` :param value: The value of the key frame. :type value: ``number`` :returns: Returns ``true`` if the key frame is added successfully. :rtype: ``boolean`` :Game Scenes: Flight .. method:: clearAxis(module, fieldName) Clear axis. :param module: The part module that the axis belongs to. :type module: :class:`SpaceCenter.Module` :param fieldName: The name of the axis field, as returned by :meth:`SpaceCenter.RoboticController.axes`. :type fieldName: ``string`` :returns: Returns ``true`` if the axis is cleared successfully. :rtype: ``boolean`` :Game Scenes: Flight .. class:: RoboticAxis(fields) An axis of a robotic controller. .. note:: See :meth:`SpaceCenter.RoboticController.axes`. .. attribute:: module The part module the axis belongs to. :Type: :class:`SpaceCenter.Module` .. attribute:: fieldName The name of the field the axis controls. :Type: ``string`` Robotic Hinge ^^^^^^^^^^^^^ .. class:: RoboticHinge A robotic hinge. Obtained by calling :meth:`SpaceCenter.Part.getRoboticHinge`. .. method:: getPart() The part object for this robotic hinge. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getTargetAngle() setTargetAngle(value) Target angle. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getCurrentAngle() Current angle. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMinAngle() setMinAngle(value) The minimum angle the hinge can move to, in degrees. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxAngle() setMaxAngle(value) The maximum angle the hinge can move to, in degrees. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getRate() setRate(value) Target movement rate in :math:`\mathrm{{}^{\circ}/s}`. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getDamping() setDamping(value) Damping percentage. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getLocked() setLocked(value) Lock movement. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getMotorEngaged() setMotorEngaged(value) Whether the motor is engaged. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getIsMoving() Whether the servo is currently moving. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: moveHome() Move hinge to its built position. :Game Scenes: Flight Robotic Piston ^^^^^^^^^^^^^^ .. class:: RoboticPiston A robotic piston part. Obtained by calling :meth:`SpaceCenter.Part.getRoboticPiston`. .. method:: getPart() The part object for this robotic piston. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getTargetExtension() setTargetExtension(value) Target extension of the piston. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getCurrentExtension() Current extension of the piston. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMinExtension() setMinExtension(value) The minimum extension of the piston, in meters. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxExtension() setMaxExtension(value) The maximum extension of the piston, in meters. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getRate() setRate(value) Target movement rate in :math:`\mathrm{m/s}`. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getDamping() setDamping(value) Damping percentage. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getLocked() setLocked(value) Lock movement. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getMotorEngaged() setMotorEngaged(value) Whether the motor is engaged. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getIsMoving() Whether the servo is currently moving. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: moveHome() Move piston to its built position. :Game Scenes: Flight Robotic Rotation ^^^^^^^^^^^^^^^^ .. class:: RoboticRotation A robotic rotation servo. Obtained by calling :meth:`SpaceCenter.Part.getRoboticRotation`. .. method:: getPart() The part object for this robotic rotation servo. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getTargetAngle() setTargetAngle(value) Target angle. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getCurrentAngle() Current angle. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMinAngle() setMinAngle(value) The minimum angle the servo can rotate to, in degrees. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxAngle() setMaxAngle(value) The maximum angle the servo can rotate to, in degrees. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getAllowFullRotation() setAllowFullRotation(value) Whether the servo is allowed to rotate freely through a full revolution, ignoring the angle limits. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getRate() setRate(value) Target movement rate in :math:`\mathrm{{}^{\circ}/s}`. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getDamping() setDamping(value) Damping percentage. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getLocked() setLocked(value) Lock Movement :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getMotorEngaged() setMotorEngaged(value) Whether the motor is engaged. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getIsMoving() Whether the servo is currently moving. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: moveHome() Move rotation servo to its built position. :Game Scenes: Flight Robotic Rotor ^^^^^^^^^^^^^ .. class:: RoboticRotor A robotic rotor. Obtained by calling :meth:`SpaceCenter.Part.getRoboticRotor`. .. method:: getPart() The part object for this robotic rotor. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getTargetRPM() setTargetRPM(value) Target RPM. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getCurrentRPM() Current RPM. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getInverted() setInverted(value) Whether the rotor direction is inverted. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getTorqueLimit() setTorqueLimit(value) Torque limit percentage. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxTorque() setMaxTorque(value) The maximum torque the rotor can generate, in kilonewtons. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getBrakePercentage() setBrakePercentage(value) The percentage of braking force applied to the rotor. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight .. method:: getLocked() setLocked(value) Lock movement. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getMotorEngaged() setMotorEngaged(value) Whether the motor is engaged. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getIsMoving() Whether the rotor is currently moving. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight RCS ^^^ .. class:: RCS An RCS block or thruster. Obtained by calling :meth:`SpaceCenter.Part.getRCS`. .. method:: getPart() The part object for this RCS. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getActive() Whether the RCS thrusters are active. An RCS thruster is inactive if the RCS action group is disabled (:meth:`SpaceCenter.Control.getRCS`), the RCS thruster itself is not enabled (:meth:`SpaceCenter.RCS.getEnabled`), or it is covered by a fairing (:meth:`SpaceCenter.Part.getShielded`) and cannot thrust while shielded. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: getEnabled() setEnabled(value) Whether the RCS thrusters are enabled. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPitchEnabled() setPitchEnabled(value) Whether the RCS thruster will fire when pitch control input is given. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getYawEnabled() setYawEnabled(value) Whether the RCS thruster will fire when yaw control input is given. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getRollEnabled() setRollEnabled(value) Whether the RCS thruster will fire when roll control input is given. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getForwardEnabled() setForwardEnabled(value) Whether the RCS thruster will fire when forward control input is given. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getUpEnabled() setUpEnabled(value) Whether the RCS thruster will fire when up control input is given. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getRightEnabled() setRightEnabled(value) Whether the RCS thruster will fire when right control input is given. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getInputOverride() setInputOverride(value) Whether the RCS control is being set directly, bypassing the vessel's normal flight controls. When enabled, the rotation and translation demand is set by :meth:`SpaceCenter.RCS.getRotationOverride` and :meth:`SpaceCenter.RCS.getTranslationOverride` instead of the normal control inputs. The override is automatically released if the controlling client disconnects or the vessel changes. Precision mode leaves an overridden block at full thrust. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getRotationOverride() setRotationOverride(value) The rotation demand applied when :meth:`SpaceCenter.RCS.getInputOverride` is enabled, in the pitch, roll and yaw axes. Each component is a normalized control input between -1 and 1. :Property: Can be read or written :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: The block ignores the component for an axis it is disabled for, such as pitch when :meth:`SpaceCenter.RCS.getPitchEnabled` is ``false``. .. method:: getTranslationOverride() setTranslationOverride(value) The translation demand applied when :meth:`SpaceCenter.RCS.getInputOverride` is enabled, in the right, up and forward axes. Each component is a normalized control input between -1 and 1. :Property: Can be read or written :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: The block ignores the component for an axis it is disabled for, such as right when :meth:`SpaceCenter.RCS.getRightEnabled` is ``false``. .. method:: getAvailableTorque() The available torque, in :math:`\mathrm{N \cdot m}`, that can be produced by this RCS, in the positive and negative pitch, roll and yaw axes of the vessel. These axes correspond to the coordinate axes of the :meth:`SpaceCenter.Vessel.getReferenceFrame`. Returns zero if RCS is disable. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AxisRange` :Game Scenes: Flight .. note:: Precision mode weakens the block, and the available torque follows it. A block driven by :meth:`SpaceCenter.RCS.getInputOverride` is exempt, so :meth:`SpaceCenter.RCS.overrideWrench` can report the larger torque an override reaches. .. method:: getAvailableForce() The available force, in Newtons, that can be produced by this RCS, in the positive and negative x, y and z axes of the vessel. These axes correspond to the coordinate axes of the :meth:`SpaceCenter.Vessel.getReferenceFrame`. Returns zero if RCS is disabled. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.AxisRange` :Game Scenes: Flight .. note:: Precision mode weakens the block, and the available force follows it. A block driven by :meth:`SpaceCenter.RCS.getInputOverride` is exempt, so :meth:`SpaceCenter.RCS.overrideWrench` can report the larger force an override reaches. .. method:: getForce() The force being applied by the RCS thrusters, in Newtons. The vector is in the vessel's reference frame (:meth:`SpaceCenter.Vessel.getReferenceFrame`). Returns zero if the RCS is inactive. :Property: Read-only, cannot be set :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getTorque() The torque being applied by the RCS thrusters about the vessel's center of mass, in :math:`\mathrm{N \cdot m}`. The vector is in the vessel's reference frame (:meth:`SpaceCenter.Vessel.getReferenceFrame`). Returns zero if the RCS is inactive. :Property: Read-only, cannot be set :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: overrideWrench(rotation, translation) The force and torque the given demands would produce, in Newtons and :math:`\mathrm{N \cdot m}`. :param rotation: A rotation demand, as set by :meth:`SpaceCenter.RCS.getRotationOverride`. :type rotation: ``[number, number, number]`` :param translation: A translation demand, as set by :meth:`SpaceCenter.RCS.getTranslationOverride`. :type translation: ``[number, number, number]`` :returns: The force, and the torque about the vessel's center of mass, in the vessel's reference frame (:meth:`SpaceCenter.Vessel.getReferenceFrame`), or zero if the RCS is inactive. :rtype: :class:`SpaceCenter.Wrench` :Game Scenes: Flight .. note:: The demands do not have to be applied. The prediction leaves out full thrust, which :meth:`SpaceCenter.RCS.getForce` and :meth:`SpaceCenter.RCS.getTorque` include. .. method:: getAvailableThrust() The amount of thrust, in Newtons, that would be produced by the thruster when activated. Returns zero if the thruster does not have any fuel. Takes the thrusters current :meth:`SpaceCenter.RCS.getThrustLimit` and atmospheric conditions into account. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxThrust() The maximum amount of thrust that can be produced by the RCS thrusters when active, in Newtons, with the :meth:`SpaceCenter.RCS.getThrustLimit` set to 100%. Takes atmospheric conditions into account. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getMaxVacuumThrust() The maximum amount of thrust that can be produced by the RCS thrusters when active in a vacuum, in Newtons. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getThrustLimit() setThrustLimit(value) The thrust limiter of the thruster. A value between 0 and 1. :Property: Can be read or written :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getThrusters() A list of thrusters, one of each nozzel in the RCS part. :Property: Read-only, cannot be set :rtype: ``Array`` of :class:`SpaceCenter.Thruster` :Game Scenes: Flight .. method:: getSpecificImpulse() The current specific impulse of the RCS, in seconds. Returns zero if the RCS is not active. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getVacuumSpecificImpulse() The vacuum specific impulse of the RCS, in seconds. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getKerbinSeaLevelSpecificImpulse() The specific impulse of the RCS at sea level on Kerbin, in seconds. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPropellants() The names of resources that the RCS consumes. :Property: Read-only, cannot be set :rtype: ``Array`` of ``string`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getPropellantRatios() The ratios of resources that the RCS consumes. A dictionary mapping resource names to the ratios at which they are consumed by the RCS. :Property: Read-only, cannot be set :rtype: ``Map`` from ``string`` to ``number`` :Game Scenes: Flight .. method:: getHasFuel() Whether the RCS has fuel available. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight Sensor ^^^^^^ .. class:: Sensor A sensor, such as a thermometer. Obtained by calling :meth:`SpaceCenter.Part.getSensor`. .. method:: getPart() The part object for this sensor. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getActive() setActive(value) Whether the sensor is active. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getValue() The current value of the sensor. :Property: Read-only, cannot be set :rtype: ``string`` :Game Scenes: Flight .. note:: This is the same readout string shown in the part's right-click menu in-game, and is intended for display rather than for parsing. Both its units and the way it formats numbers follow the language the game is running in, so it is not stable across locales. For programmatic access to the underlying quantities, use :meth:`SpaceCenter.Part.getTemperature` (temperature sensors), :meth:`SpaceCenter.Flight.getGForce` (accelerometers) or :meth:`SpaceCenter.Flight.getStaticPressure` (barometers). Solar Panel ^^^^^^^^^^^ .. class:: SolarPanel A solar panel. Obtained by calling :meth:`SpaceCenter.Part.getSolarPanel`. .. note:: Includes the curved solar panels of Near Future Solar. .. method:: getPart() The part object for this solar panel. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployable() Whether the solar panel is deployable. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight, Editor Vab, Editor Sph .. method:: getDeployed() setDeployed(value) Whether the solar panel is extended. :Property: Can be read or written :rtype: ``boolean`` :Game Scenes: Flight .. method:: getState() The current state of the solar panel. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` :Game Scenes: Flight .. method:: getEnergyFlow() The current amount of energy being generated by the solar panel, in units of charge per second. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getSunExposure() The current amount of sunlight that is incident on the solar panel, as a percentage. A value between 0 and 1. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight Thruster ^^^^^^^^ .. class:: Thruster The component of an :class:`SpaceCenter.Engine` or :class:`SpaceCenter.RCS` part that generates thrust. Can obtained by calling :meth:`SpaceCenter.Engine.getThrusters` or :meth:`SpaceCenter.RCS.getThrusters`. .. note:: Engines can consist of multiple thrusters. For example, the S3 KS-25x4 "Mammoth" has four rocket nozzels, and so consists of four thrusters. .. method:: getPart() The :meth:`SpaceCenter.Thruster.getPart` that contains this thruster. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` :Game Scenes: Flight .. method:: getThrust() The thrust being produced by the thruster, in Newtons. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: thrustPosition(referenceFrame) The position at which the thruster generates thrust, in the given reference frame. For gimballed engines, this takes into account the current rotation of the gimbal. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: thrustDirection(referenceFrame) The direction of the force generated by the thruster, in the given reference frame. This is opposite to the direction in which the thruster expels propellant. For gimballed engines, this takes into account the current rotation of the gimbal. :param referenceFrame: The reference frame that the returned direction is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The direction as a unit vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getThrustReferenceFrame() A reference frame that is fixed relative to the thruster and orientated with its thrust direction (:meth:`SpaceCenter.Thruster.thrustDirection`). For gimballed engines, this takes into account the current rotation of the gimbal. * The origin is at the position of thrust for this thruster (:meth:`SpaceCenter.Thruster.thrustPosition`). * The axes rotate with the thrust direction. This is the direction in which the thruster expels propellant, including any gimballing. * The y-axis points along the thrust direction. * The x-axis and z-axis are perpendicular to the thrust direction. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.ReferenceFrame` :Game Scenes: Flight .. method:: getGimballed() Whether the thruster is gimballed. :Property: Read-only, cannot be set :rtype: ``boolean`` :Game Scenes: Flight .. method:: gimbalPosition(referenceFrame) Position around which the gimbal pivots. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getGimbalAngle() The current gimbal angle in the pitch, roll and yaw axes, in degrees. :Property: Read-only, cannot be set :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: initialThrustPosition(referenceFrame) The position at which the thruster generates thrust, when the engine is in its initial position (no gimballing), in the given reference frame. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. note:: This position can move when the gimbal rotates. This is because the thrust position and gimbal position are not necessarily the same. .. method:: initialThrustDirection(referenceFrame) The direction of the force generated by the thruster, when the engine is in its initial position (no gimballing), in the given reference frame. This is opposite to the direction in which the thruster expels propellant. :param referenceFrame: The reference frame that the returned direction is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The direction as a unit vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight Wheel ^^^^^ .. class:: Wheel A wheel. Includes landing gear and rover wheels. Obtained by calling :meth:`SpaceCenter.Part.getWheel`. Can be used to control the motors, steering and deployment of wheels, among other things. .. method:: getPart() The part object for this wheel. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.Part` .. method:: getState() The current state of the wheel. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.DeployableState` .. method:: getRadius() Radius of the wheel, in meters. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getGrounded() Whether the wheel is touching the ground. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getHasBrakes() Whether the wheel has brakes. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getBrakes() setBrakes(value) The braking force, as a percentage of maximum, when the brakes are applied. :Property: Can be read or written :rtype: ``number`` .. method:: getAutoFrictionControl() setAutoFrictionControl(value) Whether automatic friction control is enabled. :Property: Can be read or written :rtype: ``boolean`` .. method:: getManualFrictionControl() setManualFrictionControl(value) Manual friction control value. Only has an effect if automatic friction control is disabled. A value between 0 and 5 inclusive. :Property: Can be read or written :rtype: ``number`` .. method:: getDeployable() Whether the wheel is deployable. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getDeployed() setDeployed(value) Whether the wheel is deployed. :Property: Can be read or written :rtype: ``boolean`` .. method:: getPowered() Whether the wheel is powered by a motor. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getMotorEnabled() setMotorEnabled(value) Whether the motor is enabled. :Property: Can be read or written :rtype: ``boolean`` .. method:: getMotorInverted() setMotorInverted(value) Whether the direction of the motor is inverted. :Property: Can be read or written :rtype: ``boolean`` .. method:: getMotorState() Whether the direction of the motor is inverted. :Property: Read-only, cannot be set :rtype: :class:`SpaceCenter.MotorState` .. method:: getMotorOutput() The output of the motor. This is the torque currently being generated, in :math:`\mathrm{N \cdot m}`. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getTractionControlEnabled() setTractionControlEnabled(value) Whether automatic traction control is enabled. A wheel only has traction control if it is powered. :Property: Can be read or written :rtype: ``boolean`` .. method:: getTractionControl() setTractionControl(value) Setting for the traction control. Only takes effect if the wheel has automatic traction control enabled. A value between 0 and 5 inclusive. :Property: Can be read or written :rtype: ``number`` .. method:: getDriveLimiter() setDriveLimiter(value) Manual setting for the motor limiter. Only takes effect if the wheel has automatic traction control disabled. A value between 0 and 100 inclusive. :Property: Can be read or written :rtype: ``number`` .. method:: getSteerable() Whether the wheel has steering. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getSteeringEnabled() setSteeringEnabled(value) Whether the wheel steering is enabled. :Property: Can be read or written :rtype: ``boolean`` .. method:: getSteeringInverted() setSteeringInverted(value) Whether the wheel steering is inverted. :Property: Can be read or written :rtype: ``boolean`` .. method:: getSteeringAngleAuto() setSteeringAngleAuto(value) Whether the steering angle is automatically limited based on the vessel's speed, reducing the maximum angle as the vessel moves faster. See also :meth:`SpaceCenter.Wheel.getSteeringAngleLimit`. :Property: Can be read or written :rtype: ``boolean`` .. method:: getSteeringAngleLimit() setSteeringAngleLimit(value) The steering angle limit. :Property: Can be read or written :rtype: ``number`` .. method:: getSteeringResponseTime() setSteeringResponseTime(value) Steering response time. :Property: Can be read or written :rtype: ``number`` .. method:: getHasSuspension() Whether the wheel has suspension. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getSuspensionSpringStrength() Suspension spring strength, as set in the editor. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getSuspensionDamperStrength() Suspension damper strength, as set in the editor. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getSuspensionSpring() The spring constant of the suspension, in :math:`\mathrm{kN/m}`, or ``null`` while the wheel is not grounded. Throws an exception if the wheel has no suspension. :Property: Read-only, cannot be set :rtype: ``number`` or ``null`` :Game Scenes: Flight .. note:: The game updates it while the wheel is grounded, from :meth:`SpaceCenter.Wheel.getSuspensionSpringStrength`, the vessel's mass, the wheel's compression and the local gravity. .. method:: getSuspensionDamper() The damping constant of the suspension, in :math:`\mathrm{kN \cdot s/m}`, or ``null`` while the wheel is not grounded. Throws an exception if the wheel has no suspension. :Property: Read-only, cannot be set :rtype: ``number`` or ``null`` :Game Scenes: Flight .. note:: The game updates it while the wheel is grounded, from :meth:`SpaceCenter.Wheel.getSuspensionDamperStrength` and :meth:`SpaceCenter.Wheel.getSuspensionSpring`. .. method:: getSuspensionTravel() The travel of the suspension, in meters. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. method:: getLoad() The force pressing the wheel into the ground, in :math:`\mathrm{kN}`. :Property: Read-only, cannot be set :rtype: ``number`` :Game Scenes: Flight .. note:: The game raises the load of a grounded wheel to at least 0.5 kN, or 10 kN for a wheel with the old friction model. :meth:`SpaceCenter.Wheel.getImpactTolerance` applies to the rise in this value. .. method:: contactPosition(referenceFrame) The position of the bottom of the wheel, in the given reference frame. While the wheel is grounded, this is where it touches the ground. :param referenceFrame: The reference frame that the returned position vector is in. :type referenceFrame: :class:`SpaceCenter.ReferenceFrame` :returns: The position as a vector. :rtype: ``[number, number, number]`` :Game Scenes: Flight .. method:: getBroken() Whether the wheel is broken. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getRepairable() Whether the wheel is repairable. :Property: Read-only, cannot be set :rtype: ``boolean`` .. method:: getStress() Current stress on the wheel. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getStressTolerance() Stress tolerance of the wheel. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getImpactTolerance() The rise in :meth:`SpaceCenter.Wheel.getLoad` over one physics tick that breaks the wheel, in :math:`\mathrm{kN}`. Throws an exception if the wheel is not breakable. :Property: Read-only, cannot be set :rtype: ``number`` .. note:: The game scales the rise by the local gravity divided by standard gravity before comparing it with this tolerance. .. method:: getExplodeMultiplier() The multiple of :meth:`SpaceCenter.Wheel.getImpactTolerance` that destroys the wheel, in place of breaking it. Throws an exception if the wheel is not breakable. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getStressPercentage() Current stress on the wheel as a percentage of its stress tolerance. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getDeflection() Current deflection of the wheel. :Property: Read-only, cannot be set :rtype: ``number`` .. method:: getSlip() Current slip of the wheel. :Property: Read-only, cannot be set :rtype: ``number`` .. class:: MotorState The state of the motor on a powered wheel. See :meth:`SpaceCenter.Wheel.getMotorState`. .. attribute:: idle The motor is idle. .. attribute:: running The motor is running. .. attribute:: disabled The motor is disabled. .. attribute:: inoperable The motor is inoperable. .. attribute:: notEnoughResources The motor does not have enough resources to run.