Difference between revisions of "API:Vessel"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (-typo;)
m (Added some descriptions)
 
(12 intermediate revisions by 6 users not shown)
Line 1: Line 1:
A Vessel represents a ship, or a piece of debris that was once part of a ship. You can access the vessel that your Part is part of with this.vessel. Particularly useful members are vessel.orbit, which gives your orbit, and vessel.mainBody, which gives CelestialBody whose influence you are currently under.
+
A '''Vessel''' represents a ship, or a piece of debris that was once part of a ship. You can access the vessel that your Part is part of with this.vessel. Particularly useful members are vessel.orbit, which gives your orbit, and vessel.mainBody, which gives CelestialBody whose influence you are currently under.
  
<!-- Autogenerated by DOCTOOL. Yell at N3X15 if it breaks. -->
+
<!-- Class tables autogenerated by Glyph's kerbal_wiki_pdoc program for KSP 1.04. Using syntax set up for the wiki by N3X15, format from DOCTOOLS (I'm not clear if DOCTOOLS is the script used to generate N3X15's old version of these tables, or some mediawiki thing). -->
 
{{Class
 
{{Class
|inherits=<ul><li>{{Type|MonoBehaviour}}</li><li>{{Type|IShipconstruct}}</li><li>{{Type|ITargetable}}</li></ul>
+
  |inherits={{Type|MonoBehaviour}}
|name=Vessel
+
  |implements=<ul><li>{{Type|IShipconstruct}}</li><li>{{Type|ITargetable}}</li><li>{{Type|IDiscoverable}}</li></ul>
|summary=Vessels define individual ships in flight. They work essentially as a header for the set of parts that make up the ship.
+
  |name=Vessel
 +
  |summary=Vessels define individual ships in flight. They work essentially as a header for the set of parts that make up the ship.
 
}}
 
}}
{{PropertiesStart}}
+
{{Properties|properties=
 
{{Property
 
{{Property
|type=string
+
  |type=ActionGroupList
|name=landedAt
+
  |name=ActionGroups
|desc=
+
  |desc=?
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=Part
+
  |type=VesselAutopilot
|name=this
+
  |name=Autopilot
|desc=
+
  |desc=?
|hasget=1
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=enum
+
  |type=Vector3
|name=Situations
+
  |name=CurrentCoM
|desc=
+
  |desc=?
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=DiscoveryInfo
|name=isCommandable
+
  |name=DiscoveryInfo
|desc=
+
  |desc=?
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=float
|name=packed
+
  |name=distanceLandedPackThreshold
|desc=
+
  |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=float
|name=LandedOrSplashed
+
  |name=distanceLandedUnpackThreshold
|desc=
+
  |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=1
+
  |hasget=1
|hasset=1
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=ActionGroupList
+
  |type=float
|name=ActionGroups
+
  |name=distancePackThreshold
|desc=
+
  |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=Transform
+
  |type=float
|name=ReferenceTransform
+
  |name=distanceUnpackThreshold
|desc=The reference transform is used to define the orientation of a vessel for controls and gauges. It defines which way is 'up' or 'forward' or which way pitch rotates, for instance. Read only. Use SetReferenceTransform to set. Defaults to vessel transform if no other transform is set.
+
  |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=1
+
  |hasget=1
|hasset=
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=double
+
  |type=bool
|name=launchTime
+
  |name=HoldPhysics
|desc=
+
  |desc=?
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=bool
|name=HoldPhysics
+
  |name=isActiveVessel
|desc=
+
  |desc=Returns true if this is the vessel that is currently being controled by the player.
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=PatchedConicSolver
+
  |type=bool
|name=patchedConicSolver
+
  |name=isCommandable
|desc=
+
  |desc=?
|hasget=1
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=Situations
+
  |type=bool
|name=situation
+
  |name=IsControllable
|desc=
+
  |desc=?
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
{{PropertiesEnd}}
+
{{Property
{{FieldsStart}}
+
  |type=bool
 +
  |name=isEVA
 +
  |desc=True if the vessel is an EVA kerbal.
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=bool
 +
  |name=isPersistent
 +
  |desc=?
 +
  |hasget=1
 +
  |hasset=1
 +
}}
 +
{{Property
 +
  |type=bool
 +
  |name=IsRecoverable
 +
  |desc=Returns true if this vessel is recoverable (ex. is splashed down or landed on Kerbin and is not moving).
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=bool
 +
  |name=LandedOrSplashed
 +
  |desc=Returns true if the vessel is splashed down or landed.
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=CelestialBody
 +
  |name=mainBody
 +
  |desc=?
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=Orbit
 +
  |name=orbit
 +
  |desc=?
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=List&#x3008;Part&#x3009;
 +
  |name=Parts
 +
  |desc=?
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=bool
 +
  |name=PatchedConicsAttached
 +
  |desc=?
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=Transform
 +
  |name=ReferenceTransform
 +
  |desc=The reference transform is used to define the orientation of a vessel for controls and gauges. It defines which way is 'up' or 'forward' or which way pitch rotates, for instance. Read only. Use SetReferenceTransform to set. Defaults to vessel transform if no other transform is set.
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=VesselValues
 +
  |name=VesselValues
 +
  |desc=?
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=static float
 +
  |name=loadDistance
 +
  |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
 +
  |hasget=1
 +
  |hasset=1
 +
}}
 +
{{Property
 +
  |type=static float
 +
  |name=unloadDistance
 +
  |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
 +
  |hasget=1
 +
  |hasset=1
 +
}}
 +
}}
 +
 
 +
{{Fields|
 
{{Field
 
{{Field
|type=double
+
  |type=Vector3d
|name=verticalSpeed
+
  |name=acceleration
|desc=The vertical speed of the vessel, relative to the surface of the reference body.
+
  |desc=The current acceleration vector of the vessel.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=double
|name=rb_velocity
+
  |name=altitude
|desc=The current velocity of the Unity physics rigidbody.
+
  |desc=Height above the surface of the reference body, including liquid bodies.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Quaternion
+
  |type=Vector3
|name=srfRelRotation
+
  |name=angularMomentum
|desc=The Quaternion corresponding to the vessel's rotation, relative to the surface of reference body.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=Vector3
|name=staticPressure
+
  |name=angularVelocity
|desc=The current static pressure of the vessel, presumably in newtons per meter squared.
+
  |desc=The angular velocity vector of the vessel.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=double
|name=acceleration
+
  |name=atmDensity
|desc=The current acceleration vector of the vessel.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=double
|name=geeForce
+
  |name=atmosphericTemperature
|desc=The current magnitude of gravity, in meters per second squared.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=int
+
  |type=Vector3d
|name=currentStage
+
  |name=CentrifugalAcc
|desc=Current stage of the vessel.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=ProtoVessel
+
  |type=Vector3
|name=protoVessel
+
  |name=CoM
|desc=
+
  |desc=The vector corresponding to the vessel's center of mass, relative to the vessel origin.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=double
|name=obt_velocity
+
  |name=convectiveCoefficient
|desc=The orbital velocity vector of the vessel, relative to the reference body.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=double
|name=upAxis
+
  |name=convectiveMachFlux
|desc=Vector corresponding to the vessel's up facing direction.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=string
+
  |type=Vector3d
|name=vesselName
+
  |name=CoriolisAcc
|desc=Name identifier of the vessel.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=FlightCtrlState
|name=specificAcceleration
+
  |name=ctrlState
|desc=Specific acceleration is the vessel's potential acceleration per unit of throttle. Used to estimate burn times and such. NOTE: this value is calculated based on smoothed acceleration, so it isn't completely accurate. It will also change as the vessel's mass is reduced as fuel burns away. (it does get pretty accurate after burning for a few seconds)
+
  |desc=The vessel's flight control state object, used for accessing and modifying user and fly-by-wire input.
 
}}
 
}}
 
{{Field
 
{{Field
|type=float
+
  |type=int
|name=heightFromTerrain
+
  |name=currentStage
|desc=The vessel's altitude above the reference body's terrain, not including liquid bodies.
+
  |desc=Current stage of the vessel.
 
}}
 
}}
 
{{Field
 
{{Field
|type=OrbitDriver
+
  |type=bool
|name=orbitDriver
+
  |name=directSunlight
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=FlightIntegrator
+
  |type=double
|name=flightIntegrator
+
  |name=distanceToSun
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=FlightCtrlState
+
  |type=double
|name=ctrlState
+
  |name=dynamicPressurekPa
|desc=The vessel's flight control state object, used for accessing and modifying user and fly-by-wire input.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=KerbalEVA
|name=terrainNormal
+
  |name=evaController
|desc=The vector perpendicular to the terrain.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=static
+
  |type=double
|name=float
+
  |name=externalTemperature
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=ConfigNode
|name=pqsAltitude
+
  |name=flightPlanNode
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=double
|name=terrainAltitude
+
  |name=geeForce
|desc=The height of the terrain, relative to the center of the reference body.
+
  |desc=The current magnitude of gravity, in meters per second squared. (Is this right? geeForce is not gravity)
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=double
|name=angularVelocity
+
  |name=geeForce_immediate
|desc=The angular velocity vector of the vessel.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=PatchedConicRenderer
+
  |type=Vector3d
|name=patchedConicRenderer
+
  |name=gForce
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=CelestialBody
+
  |type=bool
|name=mainBody
+
  |name=handlePhysicsStats
|desc=The reference body of the vessel.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=float
|name=isPersistent
+
  |name=heightFromSurface
|desc=
+
  |desc=The height above the surface of the reference body, including liquid bodies.
 
}}
 
}}
 
{{Field
 
{{Field
|type=OrbitTargeter
+
  |type=float
|name=orbitTargeter
+
  |name=heightFromTerrain
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=float
+
  |type=double
|name=heightFromSurface
+
  |name=horizontalSrfSpeed
|desc=The height above the surface of the reference body, including liquid bodies.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=Guid
|name=Landed
+
  |name=id
|desc=True if the vessel has landed.
+
  |desc=Unique identifier for each vessel.
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=double
|name=isEVA
+
  |name=indicatedAirSpeed
|desc=True if the vessel is an EVA kerbal.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=bool
|name=HasActiveCrew
+
  |name=Landed
|desc=True if the vessel has at least one crewmember and is active (focused).
+
  |desc=True if the vessel has landed.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=string
|name=perturbation
+
  |name=landedAt
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=double
|name=missionTime
+
  |name=latitude
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=double
|name=CoM
+
  |name=launchTime
|desc=The vector corresponding to the vessel's center of mass, relative to the vessel origin.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=bool
|name=longitude
+
  |name=loaded
|desc=
+
  |desc=True if the vessel has loaded.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Part
+
  |type=Vector3
|name=rootPart
+
  |name=localCoM
|desc=The root part of the vessel.
+
  |desc=This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Orbit
+
  |type=double
|name=orbit
+
  |name=longitude
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=double
|name=loaded
+
  |name=mach
|desc=True if the vessel has loaded.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=uint
+
  |type=double
|name=referenceTransformId
+
  |name=missionTime
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=Vector3
|name=latitude
+
  |name=MOI
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=double
|name=isActiveVessel
+
  |name=obt_speed
|desc=True if the vessel is the active vessel.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=Vector3d
|name=altitude
+
  |name=obt_velocity
|desc=Height above the surface of the reference body, including liquid bodies.
+
  |desc=The orbital velocity vector of the vessel, relative to the reference body.
 
}}
 
}}
 
{{Field
 
{{Field
|type=State
+
  |type=FlightInputCallback
|name=state
+
  |name=OnAutopilotUpdate
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=enum
+
  |type=FlightInputCallback
|name=State
+
  |name=OnFlyByWire
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=Callback
|name=localCoM
+
  |name=OnJustAboutToBeDestroyed
|desc=This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass.
+
  |desc=?
 
}}
 
}}
 
{{Field
 
{{Field
|type=Guid
+
  |type=FlightInputCallback
|name=id
+
  |name=OnPostAutopilotUpdate
|desc=Unique identifier for each vessel.
+
  |desc=?
 
}}
 
}}
{{FieldsEnd}}
+
{{Field
{{MethodsStart}}
+
  |type=FlightInputCallback
{{StaticMethod
+
  |name=OnPreAutopilotUpdate
|returntype=string
+
  |desc=?
|returndesc=
+
}}
|name=GetMETString
+
{{Field
|args=
+
  |type=OrbitDriver
|desc=
+
  |name=orbitDriver
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=OrbitRenderer
 +
  |name=orbitRenderer
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=OrbitTargeter
 +
  |name=orbitTargeter
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=bool
 +
  |name=packed
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=List&#x3008;Part&#x3009;
 +
  |name=parts
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=PatchedConicRenderer
 +
  |name=patchedConicRenderer
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=PatchedConicSolver
 +
  |name=patchedConicSolver
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=Vector3d
 +
  |name=perturbation
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=pqsAltitude
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=ProtoVessel
 +
  |name=protoVessel
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=Vector3
 +
  |name=rb_velocity
 +
  |desc=The current velocity of the Unity physics rigidbody.
 +
}}
 +
{{Field
 +
  |type=uint
 +
  |name=referenceTransformId
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=Part
 +
  |name=rootPart
 +
  |desc=The root part of the vessel.
 +
}}
 +
{{Field
 +
  |type=Situations
 +
  |name=situation
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=solarFlux
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=specificAcceleration
 +
  |desc=Specific acceleration is the vessel's potential acceleration per unit of throttle. Used to estimate burn times and such. NOTE: this value is calculated based on smoothed acceleration, so it isn't completely accurate. It will also change as the vessel's mass is reduced as fuel burns away. (it does get pretty accurate after burning for a few seconds)
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=speed
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=speedOfSound
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=bool
 +
  |name=Splashed
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=Vector3d
 +
  |name=srf_velocity
 +
  |desc=The velocity vector of the vessel while in the atmosphere. (Prograde)
 +
}}
 +
{{Field
 +
  |type=Quaternion
 +
  |name=srfRelRotation
 +
  |desc=The Quaternion corresponding to the vessel's rotation, relative to the surface of reference body.
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=srfSpeed
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=State
 +
  |name=state
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=staticPressurekPa
 +
  |desc=The current atmospheric pressure of this vessel.
 +
}}
 +
{{Field
 +
  |type=ITargetable
 +
  |name=targetObject
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=terrainAltitude
 +
  |desc=The height of the terrain, relative to the center of the reference body.
 +
}}
 +
{{Field
 +
  |type=Vector3
 +
  |name=terrainNormal
 +
  |desc=The vector perpendicular to the terrain.
 +
}}
 +
{{Field
 +
  |type=Vector3d
 +
  |name=upAxis
 +
  |desc=Vector corresponding to the vessel's up facing direction.
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=verticalSpeed
 +
  |desc=The vertical speed of the vessel, relative to the surface of the reference body.
 +
}}
 +
{{Field
 +
  |type=string
 +
  |name=vesselName
 +
  |desc=Name identifier of the vessel.
 +
}}
 +
{{Field
 +
  |type=VesselRanges
 +
  |name=vesselRanges
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=Transform
 +
  |name=vesselTransform
 +
  |desc=?
 +
}}
 +
{{Field
 +
  |type=VesselType
 +
  |name=vesselType
 +
  |desc=?
 +
}}
 +
}}
 +
 
 +
{{Methods|
 +
{{Method
 +
  |returntype=constructor
 +
  |returndesc=
 +
  |name=Vessel
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=AttachPatchedConicsSolver
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=ProtoVessel
 +
  |returndesc=
 +
  |name=BackupVessel
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=CalculatePhysicsStats
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=ChangeWorldVelocity
 +
  |args={{arg|Vector3d|velOffset}}
 +
  |desc=change the worldspace velocity of this vessel
 +
}}
 +
{{Method
 +
  |returntype=bool
 +
  |returndesc=
 +
  |name=checkLanded
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=bool
 +
  |returndesc=
 +
  |name=checkSplashed
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=bool
 +
  |returndesc=
 +
  |name=checkVisibility
 +
  |args=
 +
  |desc=Returns true if this vessel is within the visible range of any commandable (focusable) vessel, false otherwise.
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=ClearStaging
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=bool
 +
  |returndesc=
 +
  |name=ContainsCollider
 +
  |args={{arg|Collider|c}}
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=DespawnCrew
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=DestroyVesselComponents
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=DetachPatchedConicsSolver
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=Die
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=FallBackReferenceTransform
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=FeedInputFeed
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=VesselType
 +
  |returndesc=
 +
  |name=FindDefaultVesselType
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=Vector3
 +
  |returndesc=
 +
  |name=findLocalCenterOfMass
 +
  |args=
 +
  |desc=Finds the local center of mass recursively from the given ship part.
 +
}}
 +
{{Method
 +
  |returntype=Vector3
 +
  |returndesc=
 +
  |name=findLocalCenterOfPressure
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=Vector3
 +
  |returndesc=
 +
  |name=findLocalMOI
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=Vector3
 +
  |returndesc=
 +
  |name=findLocalMOI
 +
  |args={{arg|Vector3|worldCoM}}
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=List&#x3008;T&#x3009;
 +
  |returndesc=
 +
  |name=FindPartModulesImplementing&#x3008;T&#x3009;
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=Vector3
 +
  |returndesc=
 +
  |name=findWorldCenterOfMass
 +
  |args=
 +
  |desc=Finds the world center of mass recursively from the given ship part.
 +
}}
 +
{{Method
 +
  |returntype=List&#x3008;Part&#x3009;
 +
  |returndesc=
 +
  |name=GetActiveParts
 +
  |args=
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=ActiveResource
 +
  |returndesc=
 +
  |name=GetActiveResource
 +
  |args={{arg|PartResourceDefinition|def}}
 +
  |desc=?
 +
}}
 +
{{Method
 +
  |returntype=List&#x3008;ActiveResource&#x3009;
 +
  |returndesc=
 +
  |name=GetActiveResources
 +
  |args=
 +
  |desc=?
 
}}
 
}}
{{StaticMethod
+
{{Method
|returntype=string
+
  |returntype=int
|returndesc=
+
  |returndesc=
|name=GetSituationString
+
  |name=GetCrewCapacity
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=int
|returndesc=
+
  |returndesc=
|name=findWorldCenterOfMass
+
  |name=GetCrewCount
|args=
+
  |args=
|desc=Finds the world center of mass recursively from the given ship part.
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=bool
+
  |returntype=Vector3
|returndesc=
+
  |returndesc=
|name=checkSplashed
+
  |name=GetFwdVector
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=float
|returndesc=
+
  |returndesc=
|name=GoOffRails
+
  |name=GetHeightFromSurface
|args=
+
  |args=
|desc=puts the ship back into a simulated orbit and reenables physics
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=OrbitDriver
+
  |returntype=float
|returndesc=
+
  |returndesc=
|name=GetOrbitDriver
+
  |name=GetHeightFromTerrain
|args=
+
  |args=
|desc=
+
  |desc=The vessel's altitude above the reference body's terrain, not including liquid bodies.
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=string
|returndesc=
+
  |returndesc=
|name=GetObtVelocity
+
  |name=GetName
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=Vector3
|returndesc=
+
  |returndesc=
|name=FallBackReferenceTransform
+
  |name=GetObtVelocity
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=Orbit
|returndesc=
+
  |returndesc=
|name=ClearStaging
+
  |name=GetOrbit
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=OrbitDriver
|returndesc=
+
  |returndesc=
|name=DestroyVesselComponents
+
  |name=GetOrbitDriver
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=Part
|returndesc=
+
  |returndesc=
|name=ResetCollisionIgnores
+
  |name=GetReferenceTransformPart
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Transform
+
  |returntype=Vector3
|returndesc=
+
  |returndesc=
|name=GetTransform
+
  |name=GetSrfVelocity
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=VesselTargetModes
|returndesc=
+
  |returndesc=
|name=ChangeWorldVelocity
+
  |name=GetTargetingMode
|args=
+
  |args=
|desc=change the worldspace velocity of this vessel
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=float
+
  |returntype=float
|returndesc=
+
  |returndesc=
|name=GetHeightFromTerrain
+
  |name=GetTotalMass
|args=
+
  |args=
|desc=
+
  |desc=Get the sum of the mass of all (physical) parts on this vessel
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=string
+
  |returntype=Transform
|returndesc=
+
  |returndesc=
|name=GetName
+
  |name=GetTransform
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=Vessel
|returndesc=
+
  |returndesc=
|name=SpawnCrew
+
  |name=GetVessel
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=float
+
  |returntype=List&#x3008;ProtoCrewMember&#x3009;
|returndesc=
+
  |returndesc=
|name=GetHeightFromSurface
+
  |name=GetVesselCrew
|args=
+
  |args=
|desc=
+
  |desc=Returns a list of ProtoCrewMembers corresponding to each kerbal on board. ProtoCrewMember contains many fields relating to the kerbals stats such as name, courage, etc.
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=ProtoVessel
+
  |returntype=Vector3d
|returndesc=
+
  |returndesc=
|name=BackupVessel
+
  |name=GetWorldPos3D
|args=
+
  |args=
|desc=
+
  |desc=Get a double precision vector for the vessel's worldspace position (for when transform.position isn't accurate enough)
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=FeedInputFeed
+
  |name=GoOffRails
|args=
+
  |args=
|desc=
+
  |desc=puts the ship back into a simulated orbit and reenables physics
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GetSrfVelocity
+
  |name=GoOnRails
|args=
+
  |args=
|desc=
+
  |desc=disables physics and puts the ship into a propagated orbit
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=bool
|returndesc=
+
  |returndesc=
|name=ResumeStaging
+
  |name=HasControlSources
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Orbit
+
  |returntype=bool
|returndesc=
+
  |returndesc=
|name=GetOrbit
+
  |name=Initialize
|args=
+
  |args={{arg|bool|fromShipAssembly}}
|desc=
+
  |desc=Initialize is used in cases where the Vessel component is added to a ship that already exists.
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=ClearToSaveStatus
|returndesc=
+
  |returndesc=
|name=SetPosition
+
  |name=IsClearToSave
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=printGroundContacts
+
  |name=Load
|args=
+
  |args=
|desc=
+
  |desc=? Has attribute [ContextMenu("Load")]
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=SetWorldVelocity
+
  |name=MakeActive
|args=
+
  |args=
|desc=set the absolute world velocity of this vessel
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=SetRotation
+
  |name=MakeInactive
|args=
+
  |args=
|desc=Sets the worldspace rotation of this vessel, and all its parts
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=DespawnCrew
+
  |name=MurderCrew
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=List<ProtoCrewMember>
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GetVesselCrew
+
  |name=OnDestroy
|args=
+
  |args=
|desc= Returns a list of ProtoCrewMembers corresponding to each kerbal on board. ProtoCrewMember contains many fields relating to the kerbals stats such as name, courage, etc.
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=findLocalCenterOfMass
+
  |name=OnLoadFlightState
|args=
+
  |args={{arg|Dictionary&#x3008;string, KSPParseable&#x3009;|dataPool}}
|desc=Finds the local center of mass recursively from the given ship part.
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=OnLoadFlightState
+
  |name=OnSaveFlightState
|args=
+
  |args={{arg|Dictionary&#x3008;string, KSPParseable&#x3009;|dataPool}}
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
  |returntype=double
|returndesc=
+
  |returndesc=
|name=GetCrewCount
+
  |name=PQSAltitude
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=OnDestroy
+
  |name=printCollisions
|args=
+
  |args=
|desc=
+
  |desc=? Has attribute [ContextMenu("Print All Collisions")]
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=OnSaveFlightState
+
  |name=printGroundContacts
|args=
+
  |args=
|desc=
+
  |desc=? Has attribute [ContextMenu("Print Ground Contacts")]
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=ClearToSaveStatus
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=IsClearToSave
+
  |name=RenameVessel
|args=
+
  |args=
|desc=
+
  |desc=? Has attribute [ContextMenu("Rename Vessel")]
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GetFwdVector
+
  |name=ResetCollisionIgnores
|args=
+
  |args=
|desc=
+
  |desc=? Has attribute [ContextMenu("Reset Collision Ignores")]
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=Translate
+
  |name=ResumeStaging
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3d
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GetWorldPos3D
+
  |name=ResumeTarget
|args=
+
  |args=
|desc=Get a double precision vector for the vessel's worldspace position (for when transform.position isn't accurate enough)
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=double
|returndesc=
+
  |returndesc=
|name=findLocalCenterOfPressure
+
  |name=RevealAltitude
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=float
|returndesc=
+
  |returndesc=
|name=Unload
+
  |name=RevealMass
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=string
|returndesc=
+
  |returndesc=
|name=StartFromBackup
+
  |name=RevealName
|args=
+
  |args=
|desc=Start from backup is used when the scene is being resumed, and the Vessel component is added before the parts themselves. Note that this method won't load the parts. It only creates the vessel object. To load parts, use the Vessel.Load() method.
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=bool
+
  |returntype=string
|returndesc=
+
  |returndesc=
|name=checkVisibility
+
  |name=RevealSituationString
|args=
+
  |args=
|desc=Returns true if this vessel is within the visible range of any commandable (focusable) vessel, false otherwise.
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=int
+
  |returntype=double
|returndesc=
+
  |returndesc=
|name=GetCrewCapacity
+
  |name=RevealSpeed
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=float
+
  |returntype=string
|returndesc=
+
  |returndesc=
|name=GetTotalMass
+
  |name=RevealType
|args=
+
  |args=
|desc=Get the sum of the mass of all (physical) parts on this vessel
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vessel
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GetVessel
+
  |name=SetActiveInternalPart
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=Die
+
  |name=SetActiveInternalPart
|args=
+
  |args={{arg|List&#x3008;Part&#x3009;|visibleParts}}
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=findLocalMOI
+
  |name=SetActiveInternalPart
|args=
+
  |args={{arg|Part|visiblePart}}
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GoOnRails
+
  |name=SetPosition
|args=
+
  |args={{arg|Vector3|position}}
|desc=disables physics and puts the ship into a propagated orbit
+
  |desc=Sets the worldspace position of this vessel, and all its parts
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=bool
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=checkLanded
+
  |name=SetPosition
|args=
+
  |args={{arg|Vector3|position}},{{arg|bool|usePristineCoords}}
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=MakeInactive
+
  |name=SetReferenceTransform
|args=
+
  |args={{arg|Part|p}}
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=SetReferenceTransform
+
  |name=SetRotation
|args=
+
  |args={{arg|Quaternion|rotation}}
|desc=
+
  |desc=Sets the worldspace rotation of this vessel, and all its parts
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=printCollisions
+
  |name=SetWorldVelocity
|args=
+
  |args={{arg|Vector3d|vel}}
|desc=
+
  |desc=set the absolute world velocity of this vessel
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=MakeActive
+
  |name=SpawnCrew
|args=
+
  |args=
|desc=
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=Initialize
+
  |name=StartFromBackup
|args=
+
  |args={{arg|ProtoVessel|pv}}
|desc=Initialize is used in cases where the Vessel component is added to a ship that already exists.
+
  |desc=Start from backup is used when the scene is being resumed, and the Vessel component is added before the parts themselves. Note that this method won't load the parts. It only creates the vessel object. To load parts, use the Vessel.Load() method.
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=SetPosition
+
  |name=Translate
|args={{arg|Vector3|position}}
+
  |args={{arg|Vector3|offset}}
|desc=Sets the worldspace position of this vessel, and all its parts
+
  |desc=?
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=Load
+
  |name=Unload
|args=
+
  |args=
|desc=
+
  |desc=? Has attribute [ContextMenu("Unload")]
 +
}}
 +
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=AutoRename
 +
  |args={{arg|Vessel|v}},{{arg|string|baseName}}
 +
  |desc=?
 
}}
 
}}
{{MethodsEnd}}
+
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=GetLandedAtString
 +
  |args={{arg|string|landedAt}}
 +
  |desc=?
 +
}}
 +
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=GetMETString
 +
  |args={{arg|Vessel|v}}
 +
  |desc=?
 +
}}
 +
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=GetSituationString
 +
  |args={{arg|Vessel|v}}
 +
  |desc=?
 +
}}
 +
{{StaticMethod
 +
  |returntype=bool
 +
  |returndesc=
 +
  |name=IsValidVesselName
 +
  |args={{arg|string|name}}
 +
  |desc=?
 +
}}
 +
}}
 +
{{Enums|enums=
 +
{{Enum
 +
  |name=Situations
 +
  |values=LANDED<br/>SPLASHED<br/>PRELAUNCH<br/>FLYING<br/>SUB_ORBITAL<br/>ORBITING<br/>ESCAPING<br/>DOCKED
 +
}}
 +
{{Enum
 +
  |name=State
 +
  |values=INACTIVE<br/>ACTIVE<br/>DEAD
 +
}}
 +
}}
 +
== Other API ==
 +
 
 +
Vessel also contains the following, not included above.
 +
 
 +
<syntaxhighlight>
 +
...
 +
public Part this[int index] { get; }
 +
public Part this[uint flightID] { get; }
 +
 
 +
public class ActiveResource
 +
{
 +
  public double amount;
 +
  public PartResourceDefinition info;
 +
  public double maxAmount;
 +
  public List<Part> parts;
 +
 
 +
  public ActiveResource(PartResourceDefinition def);
 +
}
 +
...
 +
</syntaxhighlight>
 +
 
 
[[Category:Community API Documentation]]
 
[[Category:Community API Documentation]]

Latest revision as of 21:22, 21 April 2021

A Vessel represents a ship, or a piece of debris that was once part of a ship. You can access the vessel that your Part is part of with this.vessel. Particularly useful members are vessel.orbit, which gives your orbit, and vessel.mainBody, which gives CelestialBody whose influence you are currently under.

Vessel Class

Inherits Implements
MonoBehaviour
  • IShipconstruct
  • ITargetable
  • IDiscoverable

Vessels define individual ships in flight. They work essentially as a header for the set of parts that make up the ship.

Properties

The following is a list of properties in Vessel.

Name Description
ActionGroupList ActionGroups { get; }  ?
VesselAutopilot Autopilot { get; }  ?
Vector3 CurrentCoM { get; }  ?
DiscoveryInfo DiscoveryInfo { get; }  ?
float distanceLandedPackThreshold { get; set; }  ? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
float distanceLandedUnpackThreshold { get; set; }  ? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
float distancePackThreshold { get; set; }  ? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
float distanceUnpackThreshold { get; set; }  ? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
bool HoldPhysics { get; }  ?
bool isActiveVessel { get; } Returns true if this is the vessel that is currently being controled by the player.
bool isCommandable { get; }  ?
bool IsControllable { get; }  ?
bool isEVA { get; } True if the vessel is an EVA kerbal.
bool isPersistent { get; set; }  ?
bool IsRecoverable { get; } Returns true if this vessel is recoverable (ex. is splashed down or landed on Kerbin and is not moving).
bool LandedOrSplashed { get; } Returns true if the vessel is splashed down or landed.
CelestialBody mainBody { get; }  ?
Orbit orbit { get; }  ?
List〈Part〉 Parts { get; }  ?
bool PatchedConicsAttached { get; }  ?
Transform ReferenceTransform { get; } The reference transform is used to define the orientation of a vessel for controls and gauges. It defines which way is 'up' or 'forward' or which way pitch rotates, for instance. Read only. Use SetReferenceTransform to set. Defaults to vessel transform if no other transform is set.
VesselValues VesselValues { get; }  ?
static float loadDistance { get; set; }  ? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
static float unloadDistance { get; set; }  ? Has attribute [Obsolete("Use Vessel.vesselRanges instead")]

Fields

The following is a list of fields in Vessel.

Signature Description
Vector3d acceleration The current acceleration vector of the vessel.
double altitude Height above the surface of the reference body, including liquid bodies.
Vector3 angularMomentum  ?
Vector3 angularVelocity The angular velocity vector of the vessel.
double atmDensity  ?
double atmosphericTemperature  ?
Vector3d CentrifugalAcc  ?
Vector3 CoM The vector corresponding to the vessel's center of mass, relative to the vessel origin.
double convectiveCoefficient  ?
double convectiveMachFlux  ?
Vector3d CoriolisAcc  ?
FlightCtrlState ctrlState The vessel's flight control state object, used for accessing and modifying user and fly-by-wire input.
int currentStage Current stage of the vessel.
bool directSunlight  ?
double distanceToSun  ?
double dynamicPressurekPa  ?
KerbalEVA evaController  ?
double externalTemperature  ?
ConfigNode flightPlanNode  ?
double geeForce The current magnitude of gravity, in meters per second squared. (Is this right? geeForce is not gravity)
double geeForce_immediate  ?
Vector3d gForce  ?
bool handlePhysicsStats  ?
float heightFromSurface The height above the surface of the reference body, including liquid bodies.
float heightFromTerrain  ?
double horizontalSrfSpeed  ?
Guid id Unique identifier for each vessel.
double indicatedAirSpeed  ?
bool Landed True if the vessel has landed.
string landedAt  ?
double latitude  ?
double launchTime  ?
bool loaded True if the vessel has loaded.
Vector3 localCoM This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass.
double longitude  ?
double mach  ?
double missionTime  ?
Vector3 MOI  ?
double obt_speed  ?
Vector3d obt_velocity The orbital velocity vector of the vessel, relative to the reference body.
FlightInputCallback OnAutopilotUpdate  ?
FlightInputCallback OnFlyByWire  ?
Callback OnJustAboutToBeDestroyed  ?
FlightInputCallback OnPostAutopilotUpdate  ?
FlightInputCallback OnPreAutopilotUpdate  ?
OrbitDriver orbitDriver  ?
OrbitRenderer orbitRenderer  ?
OrbitTargeter orbitTargeter  ?
bool packed  ?
List〈Part〉 parts  ?
PatchedConicRenderer patchedConicRenderer  ?
PatchedConicSolver patchedConicSolver  ?
Vector3d perturbation  ?
double pqsAltitude  ?
ProtoVessel protoVessel  ?
Vector3 rb_velocity The current velocity of the Unity physics rigidbody.
uint referenceTransformId  ?
Part rootPart The root part of the vessel.
Situations situation  ?
double solarFlux  ?
double specificAcceleration Specific acceleration is the vessel's potential acceleration per unit of throttle. Used to estimate burn times and such. NOTE: this value is calculated based on smoothed acceleration, so it isn't completely accurate. It will also change as the vessel's mass is reduced as fuel burns away. (it does get pretty accurate after burning for a few seconds)
double speed  ?
double speedOfSound  ?
bool Splashed  ?
Vector3d srf_velocity The velocity vector of the vessel while in the atmosphere. (Prograde)
Quaternion srfRelRotation The Quaternion corresponding to the vessel's rotation, relative to the surface of reference body.
double srfSpeed  ?
State state  ?
double staticPressurekPa The current atmospheric pressure of this vessel.
ITargetable targetObject  ?
double terrainAltitude The height of the terrain, relative to the center of the reference body.
Vector3 terrainNormal The vector perpendicular to the terrain.
Vector3d upAxis Vector corresponding to the vessel's up facing direction.
double verticalSpeed The vertical speed of the vessel, relative to the surface of the reference body.
string vesselName Name identifier of the vessel.
VesselRanges vesselRanges  ?
Transform vesselTransform  ?
VesselType vesselType  ?

Methods

The following are methods included in Vessel.

Signature Description
constructor Vessel()  ?
void AttachPatchedConicsSolver()  ?
ProtoVessel BackupVessel()  ?
void CalculatePhysicsStats()  ?
void ChangeWorldVelocity(Vector3d velOffset) change the worldspace velocity of this vessel
bool checkLanded()  ?
bool checkSplashed()  ?
bool checkVisibility() Returns true if this vessel is within the visible range of any commandable (focusable) vessel, false otherwise.
void ClearStaging()  ?
bool ContainsCollider(Collider c)  ?
void DespawnCrew()  ?
void DestroyVesselComponents()  ?
void DetachPatchedConicsSolver()  ?
void Die()  ?
void FallBackReferenceTransform()  ?
void FeedInputFeed()  ?
VesselType FindDefaultVesselType()  ?
Vector3 findLocalCenterOfMass() Finds the local center of mass recursively from the given ship part.
Vector3 findLocalCenterOfPressure()  ?
Vector3 findLocalMOI()  ?
Vector3 findLocalMOI(Vector3 worldCoM)  ?
List〈T〉 FindPartModulesImplementing〈T〉()  ?
Vector3 findWorldCenterOfMass() Finds the world center of mass recursively from the given ship part.
List〈Part〉 GetActiveParts()  ?
ActiveResource GetActiveResource(PartResourceDefinition def)  ?
List〈ActiveResource〉 GetActiveResources()  ?
int GetCrewCapacity()  ?
int GetCrewCount()  ?
Vector3 GetFwdVector()  ?
float GetHeightFromSurface()  ?
float GetHeightFromTerrain() The vessel's altitude above the reference body's terrain, not including liquid bodies.
string GetName()  ?
Vector3 GetObtVelocity()  ?
Orbit GetOrbit()  ?
OrbitDriver GetOrbitDriver()  ?
Part GetReferenceTransformPart()  ?
Vector3 GetSrfVelocity()  ?
VesselTargetModes GetTargetingMode()  ?
float GetTotalMass() Get the sum of the mass of all (physical) parts on this vessel
Transform GetTransform()  ?
Vessel GetVessel()  ?
List〈ProtoCrewMember〉 GetVesselCrew() Returns a list of ProtoCrewMembers corresponding to each kerbal on board. ProtoCrewMember contains many fields relating to the kerbals stats such as name, courage, etc.
Vector3d GetWorldPos3D() Get a double precision vector for the vessel's worldspace position (for when transform.position isn't accurate enough)
void GoOffRails() puts the ship back into a simulated orbit and reenables physics
void GoOnRails() disables physics and puts the ship into a propagated orbit
bool HasControlSources()  ?
bool Initialize(bool fromShipAssembly) Initialize is used in cases where the Vessel component is added to a ship that already exists.
ClearToSaveStatus IsClearToSave()  ?
void Load()  ? Has attribute [ContextMenu("Load")]
void MakeActive()  ?
void MakeInactive()  ?
void MurderCrew()  ?
void OnDestroy()  ?
void OnLoadFlightState(Dictionary〈string, KSPParseable〉 dataPool)  ?
void OnSaveFlightState(Dictionary〈string, KSPParseable〉 dataPool)  ?
double PQSAltitude()  ?
void printCollisions()  ? Has attribute [ContextMenu("Print All Collisions")]
void printGroundContacts()  ? Has attribute [ContextMenu("Print Ground Contacts")]
void RenameVessel()  ? Has attribute [ContextMenu("Rename Vessel")]
void ResetCollisionIgnores()  ? Has attribute [ContextMenu("Reset Collision Ignores")]
void ResumeStaging()  ?
void ResumeTarget()  ?
double RevealAltitude()  ?
float RevealMass()  ?
string RevealName()  ?
string RevealSituationString()  ?
double RevealSpeed()  ?
string RevealType()  ?
void SetActiveInternalPart()  ?
void SetActiveInternalPart(List〈Part〉 visibleParts)  ?
void SetActiveInternalPart(Part visiblePart)  ?
void SetPosition(Vector3 position) Sets the worldspace position of this vessel, and all its parts
void SetPosition(Vector3 position,bool usePristineCoords)  ?
void SetReferenceTransform(Part p)  ?
void SetRotation(Quaternion rotation) Sets the worldspace rotation of this vessel, and all its parts
void SetWorldVelocity(Vector3d vel) set the absolute world velocity of this vessel
void SpawnCrew()  ?
void StartFromBackup(ProtoVessel pv) Start from backup is used when the scene is being resumed, and the Vessel component is added before the parts themselves. Note that this method won't load the parts. It only creates the vessel object. To load parts, use the Vessel.Load() method.
void Translate(Vector3 offset)  ?
void Unload()  ? Has attribute [ContextMenu("Unload")]
static string AutoRename(Vessel v,string baseName)  ?
static string GetLandedAtString(string landedAt)  ?
static string GetMETString(Vessel v)  ?
static string GetSituationString(Vessel v)  ?
static bool IsValidVesselName(string name)  ?

Enumerations

The following is a list of enumerations in Vessel.

Name Values
Situations LANDED
SPLASHED
PRELAUNCH
FLYING
SUB_ORBITAL
ORBITING
ESCAPING
DOCKED
State INACTIVE
ACTIVE
DEAD

Other API

Vessel also contains the following, not included above.

...
public Part this[int index] { get; }
public Part this[uint flightID] { get; }
 
public class ActiveResource
{
  public double amount;
  public PartResourceDefinition info;
  public double maxAmount;
  public List<Part> parts;
 
  public ActiveResource(PartResourceDefinition def);
}
...