Difference between revisions of "API:Vessel"

From Kerbal Space Program Wiki
Jump to: navigation, search
(fix up 'implements' list for template change)
(Updating to 1.04 signatures and adding all methods, fields, properties)
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={{Type|MonoBehaviour}}
+
  |inherits={{Type|MonoBehaviour}}
|implements=<ul><li>{{Type|IDiscoverable}}</li><li>{{Type|IShipconstruct}}</li><li>{{Type|ITargetable}}</li></ul>
+
  |implements=<ul><li>{{Type|IShipconstruct}}</li><li>{{Type|ITargetable}}</li><li>{{Type|IDiscoverable}}</li></ul>
|name=Vessel
+
  |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.
+
  |summary=Vessels define individual ships in flight. They work essentially as a header for the set of parts that make up the ship.
 
}}
 
}}
 +
 
{{PropertiesStart}}
 
{{PropertiesStart}}
 
{{Property
 
{{Property
|type=string
+
  |type=ActionGroupList
|name=landedAt
+
  |name=ActionGroups
|desc=
+
  |desc=
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 +
}}
 +
{{Property
 +
  |type=VesselAutopilot
 +
  |name=Autopilot
 +
  |desc=
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=Vector3
 +
  |name=CurrentCoM
 +
  |desc=
 +
  |hasget=1
 +
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=Part
+
  |type=DiscoveryInfo
|name=this
+
  |name=DiscoveryInfo
|desc=
+
  |desc=
|hasget=1
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=enum
+
  |type=float
|name=Situations
+
  |name=distanceLandedPackThreshold
|desc=
+
  |desc=Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=float
|name=isCommandable
+
  |name=distanceLandedUnpackThreshold
|desc=
+
  |desc=Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=float
|name=packed
+
  |name=distancePackThreshold
|desc=
+
  |desc=Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=float
|name=LandedOrSplashed
+
  |name=distanceUnpackThreshold
|desc=
+
  |desc=Has attribute [Obsolete("Use Vessel.vesselRanges instead")]
|hasget=1
+
  |hasget=1
|hasset=1
+
  |hasset=1
 
}}
 
}}
 
{{Property
 
{{Property
|type=ActionGroupList
+
  |type=bool
|name=ActionGroups
+
  |name=HoldPhysics
|desc=
+
  |desc=
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=Transform
+
  |type=bool
|name=ReferenceTransform
+
  |name=isActiveVessel
|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=
|hasget=1
+
  |hasget=1
|hasset=
+
  |hasset=True if the vessel is the active vessel.
 
}}
 
}}
 
{{Property
 
{{Property
|type=double
+
  |type=bool
|name=launchTime
+
  |name=isCommandable
|desc=
+
  |desc=
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=bool
+
  |type=bool
|name=HoldPhysics
+
  |name=IsControllable
|desc=
+
  |desc=
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=PatchedConicSolver
+
  |type=bool
|name=patchedConicSolver
+
  |name=isEVA
|desc=
+
  |desc=True if the vessel is an EVA kerbal.
|hasget=1
+
  |hasget=1
|hasset=
+
  |hasset=
 
}}
 
}}
 
{{Property
 
{{Property
|type=Vessel.Situations
+
  |type=bool
|name=situation
+
  |name=isPersistent
|desc=
+
  |desc=
|hasget=
+
  |hasget=1
|hasset=
+
  |hasset=1
 +
}}
 +
{{Property
 +
  |type=bool
 +
  |name=IsRecoverable
 +
  |desc=
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=bool
 +
  |name=LandedOrSplashed
 +
  |desc=
 +
  |hasget=1
 +
  |hasset=
 +
}}
 +
{{Property
 +
  |type=CelestialBody
 +
  |name=mainBody
 +
  |desc=
 +
  |hasget=1
 +
  |hasset=The reference body of the vessel.
 +
}}
 +
{{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
 
}}
 
}}
 
{{PropertiesEnd}}
 
{{PropertiesEnd}}
 +
 
{{FieldsStart}}
 
{{FieldsStart}}
 
{{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
 +
  |type=double
 +
  |name=altitude
 +
  |desc=Height above the surface of the reference body, including liquid bodies.
 +
}}
 +
{{Field
 +
  |type=Vector3
 +
  |name=angularMomentum
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=Vector3
 +
  |name=angularVelocity
 +
  |desc=The angular velocity vector of the vessel.
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=atmDensity
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=atmosphericTemperature
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=Vector3d
 +
  |name=CentrifugalAcc
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=Vector3
 +
  |name=CoM
 +
  |desc=The vector corresponding to the vessel's center of mass, relative to the vessel origin.
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=convectiveCoefficient
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=convectiveMachFlux
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=Vector3d
 +
  |name=CoriolisAcc
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=FlightCtrlState
 +
  |name=ctrlState
 +
  |desc=The vessel's flight control state object, used for accessing and modifying user and fly-by-wire input.
 +
}}
 +
{{Field
 +
  |type=int
 +
  |name=currentStage
 +
  |desc=Current stage of the vessel.
 +
}}
 +
{{Field
 +
  |type=bool
 +
  |name=directSunlight
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=distanceToSun
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=dynamicPressurekPa
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=KerbalEVA
 +
  |name=evaController
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=externalTemperature
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=ConfigNode
 +
  |name=flightPlanNode
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=geeForce
 +
  |desc=The current magnitude of gravity, in meters per second squared.
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=geeForce_immediate
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=Vector3d
 +
  |name=gForce
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=bool
 +
  |name=handlePhysicsStats
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=float
 +
  |name=heightFromSurface
 +
  |desc=The height above the surface of the reference body, including liquid bodies.
 +
}}
 +
{{Field
 +
  |type=float
 +
  |name=heightFromTerrain
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=horizontalSrfSpeed
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=Guid
 +
  |name=id
 +
  |desc=Unique identifier for each vessel.
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=indicatedAirSpeed
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=bool
 +
  |name=Landed
 +
  |desc=True if the vessel has landed.
 +
}}
 +
{{Field
 +
  |type=string
 +
  |name=landedAt
 +
  |desc=
 +
}}
 +
{{Field
 +
  |type=double
 +
  |name=latitude
 +
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=double
|name=rb_velocity
+
  |name=launchTime
|desc=The current velocity of the Unity physics rigidbody.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Quaternion
+
  |type=bool
|name=srfRelRotation
+
  |name=loaded
|desc=The Quaternion corresponding to the vessel's rotation, relative to the surface of reference body.
+
  |desc=True if the vessel has loaded.
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=Vector3
|name=staticPressure
+
  |name=localCoM
|desc=The current static pressure of the vessel, presumably in newtons per meter squared.
+
  |desc=This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=double
|name=acceleration
+
  |name=longitude
|desc=The current acceleration vector of the vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=double
|name=geeForce
+
  |name=mach
|desc=The current magnitude of gravity, in meters per second squared.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=int
+
  |type=double
|name=currentStage
+
  |name=missionTime
|desc=Current stage of the vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=ProtoVessel
+
  |type=Vector3
|name=protoVessel
+
  |name=MOI
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=double
|name=obt_velocity
+
  |name=obt_speed
|desc=The orbital velocity vector of the vessel, relative to the reference body.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=Vector3d
|name=upAxis
+
  |name=obt_velocity
|desc=Vector corresponding to the vessel's up facing direction.
+
  |desc=The orbital velocity vector of the vessel, relative to the reference body.
 
}}
 
}}
 
{{Field
 
{{Field
|type=string
+
  |type=FlightInputCallback
|name=vesselName
+
  |name=OnAutopilotUpdate
|desc=Name identifier of the vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=FlightInputCallback
|name=specificAcceleration
+
  |name=OnFlyByWire
|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=
 
}}
 
}}
 
{{Field
 
{{Field
|type=float
+
  |type=Callback
|name=heightFromTerrain
+
  |name=OnJustAboutToBeDestroyed
|desc=The vessel's altitude above the reference body's terrain, not including liquid bodies.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=OrbitDriver
+
  |type=FlightInputCallback
|name=orbitDriver
+
  |name=OnPostAutopilotUpdate
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=FlightIntegrator
+
  |type=FlightInputCallback
|name=flightIntegrator
+
  |name=OnPreAutopilotUpdate
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=FlightCtrlState
+
  |type=OrbitDriver
|name=ctrlState
+
  |name=orbitDriver
|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=OrbitRenderer
|name=terrainNormal
+
  |name=orbitRenderer
|desc=The vector perpendicular to the terrain.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=static
+
  |type=OrbitTargeter
|name=float
+
  |name=orbitTargeter
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=bool
|name=pqsAltitude
+
  |name=packed
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=List&#x3008;Part&#x3009;
|name=terrainAltitude
+
  |name=parts
|desc=The height of the terrain, relative to the center of the reference body.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=PatchedConicRenderer
|name=angularVelocity
+
  |name=patchedConicRenderer
|desc=The angular velocity vector of the vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=PatchedConicRenderer
+
  |type=PatchedConicSolver
|name=patchedConicRenderer
+
  |name=patchedConicSolver
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=CelestialBody
+
  |type=Vector3d
|name=mainBody
+
  |name=perturbation
|desc=The reference body of the vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=double
|name=isPersistent
+
  |name=pqsAltitude
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=OrbitTargeter
+
  |type=ProtoVessel
|name=orbitTargeter
+
  |name=protoVessel
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=float
+
  |type=Vector3
|name=heightFromSurface
+
  |name=rb_velocity
|desc=The height above the surface of the reference body, including liquid bodies.
+
  |desc=The current velocity of the Unity physics rigidbody.
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=uint
|name=Landed
+
  |name=referenceTransformId
|desc=True if the vessel has landed.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=Part
|name=isEVA
+
  |name=rootPart
|desc=True if the vessel is an EVA kerbal.
+
  |desc=The root part of the vessel.
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=Situations
|name=HasActiveCrew
+
  |name=situation
|desc=True if the vessel has at least one crewmember and is active (focused).
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3d
+
  |type=enum
|name=perturbation
+
  |name=Situations
|desc=
+
  |desc={ LANDED, SPLASHED, PRELAUNCH, FLYING, SUB_ORBITAL, ORBITING, ESCAPING, DOCKED }
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=double
|name=missionTime
+
  |name=solarFlux
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=double
|name=CoM
+
  |name=specificAcceleration
|desc=The vector corresponding to the vessel's center of mass, relative to the vessel origin.
+
  |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
 
{{Field
|type=double
+
  |type=double
|name=longitude
+
  |name=speed
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Part
+
  |type=double
|name=rootPart
+
  |name=speedOfSound
|desc=The root part of the vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Orbit
+
  |type=bool
|name=orbit
+
  |name=Splashed
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=Vector3d
|name=loaded
+
  |name=srf_velocity
|desc=True if the vessel has loaded.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=uint
+
  |type=Quaternion
|name=referenceTransformId
+
  |name=srfRelRotation
|desc=
+
  |desc=The Quaternion corresponding to the vessel's rotation, relative to the surface of reference body.
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=double
|name=latitude
+
  |name=srfSpeed
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=bool
+
  |type=State
|name=isActiveVessel
+
  |name=state
|desc=True if the vessel is the active vessel.
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=double
+
  |type=enum
|name=altitude
+
  |name=State
|desc=Height above the surface of the reference body, including liquid bodies.
+
  |desc={ INACTIVE, ACTIVE, DEAD }
 
}}
 
}}
 
{{Field
 
{{Field
|type=State
+
  |type=double
|name=state
+
  |name=staticPressurekPa
|desc=
+
  |desc=The current atmospheric pressure of this vessel.
 
}}
 
}}
 
{{Field
 
{{Field
|type=enum
+
  |type=ITargetable
|name=State
+
  |name=targetObject
|desc=
+
  |desc=
 
}}
 
}}
 
{{Field
 
{{Field
|type=Vector3
+
  |type=double
|name=localCoM
+
  |name=terrainAltitude
|desc=This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass.
+
  |desc=The height of the terrain, relative to the center of the reference body.
 
}}
 
}}
 
{{Field
 
{{Field
|type=Guid
+
  |type=Vector3
|name=id
+
  |name=terrainNormal
|desc=Unique identifier for each vessel.
+
  |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=
 
}}
 
}}
 
{{FieldsEnd}}
 
{{FieldsEnd}}
 +
 
{{MethodsStart}}
 
{{MethodsStart}}
{{StaticMethod
+
{{Method
|returntype=string
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GetMETString
+
  |name=AttachPatchedConicsSolver
|args=
+
  |args=
|desc=
+
  |desc=
 +
}}
 +
{{Method
 +
  |returntype=ProtoVessel
 +
  |returndesc=
 +
  |name=BackupVessel
 +
  |args=
 +
  |desc=
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=CalculatePhysicsStats
 +
  |args=
 +
  |desc=
 +
}}
 +
{{Method
 +
  |returntype=void
 +
  |returndesc=
 +
  |name=ChangeWorldVelocity
 +
  |args=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=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=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=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=bool fromShipAssembly = false
|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=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=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=List&#x3008;Part&#x3009; visibleParts
|desc=
+
  |desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=Vector3
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=findLocalMOI
+
  |name=SetActiveInternalPart
|args=
+
  |args=Part visiblePart
|desc=
+
  |desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=GoOnRails
+
  |name=SetPosition
|args=
+
  |args=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=Vector3 position, bool usePristineCoords
|desc=
+
  |desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=MakeInactive
+
  |name=SetReferenceTransform
|args=
+
  |args=Part p
|desc=
+
  |desc=
 
}}
 
}}
 
{{Method
 
{{Method
|returntype=void
+
  |returntype=void
|returndesc=
+
  |returndesc=
|name=SetReferenceTransform
+
  |name=SetRotation
|args=
+
  |args=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=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=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=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=Vessel v, string baseName
 +
  |desc=
 +
}}
 +
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=GetLandedAtString
 +
  |args=string landedAt
 +
  |desc=
 +
}}
 +
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=GetMETString
 +
  |args=Vessel v
 +
  |desc=
 +
}}
 +
{{StaticMethod
 +
  |returntype=string
 +
  |returndesc=
 +
  |name=GetSituationString
 +
  |args=Vessel v
 +
  |desc=
 +
}}
 +
{{StaticMethod
 +
  |returntype=bool
 +
  |returndesc=
 +
  |name=IsValidVesselName
 +
  |args=string name
 +
  |desc=
 
}}
 
}}
 
{{MethodsEnd}}
 
{{MethodsEnd}}
 +
 
[[Category:Community API Documentation]]
 
[[Category:Community API Documentation]]

Revision as of 03:19, 12 October 2015

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 are public properties available in Vessel.

Signature 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; set; }
bool isCommandable { get; }
bool IsControllable { get; }
bool isEVA { get; } True if the vessel is an EVA kerbal.
bool isPersistent { get; set; }
bool IsRecoverable { get; }
bool LandedOrSplashed { get; }
CelestialBody mainBody { get; set; }
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 publically-accessible fields in Vessel. This includes protected items, which can be accessed by subclasses.

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.
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
enum Situations { LANDED, SPLASHED, PRELAUNCH, FLYING, SUB_ORBITAL, ORBITING, ESCAPING, DOCKED }
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
Quaternion srfRelRotation The Quaternion corresponding to the vessel's rotation, relative to the surface of reference body.
double srfSpeed
State state
enum State { INACTIVE, ACTIVE, DEAD }
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
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 = false) 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)