Difference between revisions of "API:Vessel"
From Kerbal Space Program Wiki
m (-typo;) |
Aspacenerd (talk | contribs) 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. |
− | <!-- | + | <!-- 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| | + | |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. | ||
}} | }} | ||
− | {{ | + | {{Properties|properties= |
{{Property | {{Property | ||
− | |type= | + | |type=ActionGroupList |
− | |name= | + | |name=ActionGroups |
− | |desc= | + | |desc=? |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=VesselAutopilot |
− | |name= | + | |name=Autopilot |
− | |desc= | + | |desc=? |
− | |hasget=1 | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=Vector3 |
− | |name= | + | |name=CurrentCoM |
− | |desc= | + | |desc=? |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=DiscoveryInfo |
− | |name= | + | |name=DiscoveryInfo |
− | |desc= | + | |desc=? |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=float |
− | |name= | + | |name=distanceLandedPackThreshold |
− | |desc= | + | |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")] |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset=1 |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=float |
− | |name= | + | |name=distanceLandedUnpackThreshold |
− | |desc= | + | |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")] |
− | |hasget=1 | + | |hasget=1 |
− | |hasset=1 | + | |hasset=1 |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=float |
− | |name= | + | |name=distancePackThreshold |
− | |desc= | + | |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")] |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset=1 |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=float |
− | |name= | + | |name=distanceUnpackThreshold |
− | |desc= | + | |desc=? Has attribute [Obsolete("Use Vessel.vesselRanges instead")] |
− | |hasget=1 | + | |hasget=1 |
− | |hasset= | + | |hasset=1 |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=bool |
− | |name= | + | |name=HoldPhysics |
− | |desc= | + | |desc=? |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
{{Property | {{Property | ||
− | |type=bool | + | |type=bool |
− | |name= | + | |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= | + | |type=bool |
− | |name= | + | |name=isCommandable |
− | |desc= | + | |desc=? |
− | |hasget=1 | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
{{Property | {{Property | ||
− | |type= | + | |type=bool |
− | |name= | + | |name=IsControllable |
− | |desc= | + | |desc=? |
− | |hasget= | + | |hasget=1 |
− | |hasset= | + | |hasset= |
}} | }} | ||
− | {{ | + | {{Property |
− | {{ | + | |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〈Part〉 | ||
+ | |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= | + | |type=Vector3d |
− | |name= | + | |name=acceleration |
− | |desc=The | + | |desc=The current acceleration vector of the vessel. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=altitude |
− | |desc= | + | |desc=Height above the surface of the reference body, including liquid bodies. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3 |
− | |name= | + | |name=angularMomentum |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3 |
− | |name= | + | |name=angularVelocity |
− | |desc=The | + | |desc=The angular velocity vector of the vessel. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=atmDensity |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type=double | + | |type=double |
− | |name= | + | |name=atmosphericTemperature |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3d |
− | |name= | + | |name=CentrifugalAcc |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3 |
− | |name= | + | |name=CoM |
− | |desc= | + | |desc=The vector corresponding to the vessel's center of mass, relative to the vessel origin. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=convectiveCoefficient |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=convectiveMachFlux |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3d |
− | |name= | + | |name=CoriolisAcc |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=FlightCtrlState |
− | |name= | + | |name=ctrlState |
− | |desc= | + | |desc=The vessel's flight control state object, used for accessing and modifying user and fly-by-wire input. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=int |
− | |name= | + | |name=currentStage |
− | |desc= | + | |desc=Current stage of the vessel. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=bool |
− | |name= | + | |name=directSunlight |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=distanceToSun |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=dynamicPressurekPa |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=KerbalEVA |
− | |name= | + | |name=evaController |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=externalTemperature |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=ConfigNode |
− | |name= | + | |name=flightPlanNode |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type=double | + | |type=double |
− | |name= | + | |name=geeForce |
− | |desc=The | + | |desc=The current magnitude of gravity, in meters per second squared. (Is this right? geeForce is not gravity) |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=geeForce_immediate |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3d |
− | |name= | + | |name=gForce |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=bool |
− | |name= | + | |name=handlePhysicsStats |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=float |
− | |name= | + | |name=heightFromSurface |
− | |desc= | + | |desc=The height above the surface of the reference body, including liquid bodies. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=float |
− | |name= | + | |name=heightFromTerrain |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=horizontalSrfSpeed |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Guid |
− | |name= | + | |name=id |
− | |desc= | + | |desc=Unique identifier for each vessel. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=indicatedAirSpeed |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type=bool | + | |type=bool |
− | |name= | + | |name=Landed |
− | |desc=True if the vessel has | + | |desc=True if the vessel has landed. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=string |
− | |name= | + | |name=landedAt |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type=double | + | |type=double |
− | |name= | + | |name=latitude |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=launchTime |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=bool |
− | |name= | + | |name=loaded |
− | |desc= | + | |desc=True if the vessel has loaded. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3 |
− | |name= | + | |name=localCoM |
− | |desc= | + | |desc=This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=longitude |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=mach |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=missionTime |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3 |
− | |name= | + | |name=MOI |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=double |
− | |name= | + | |name=obt_speed |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Vector3d |
− | |name= | + | |name=obt_velocity |
− | |desc= | + | |desc=The orbital velocity vector of the vessel, relative to the reference body. |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=FlightInputCallback |
− | |name= | + | |name=OnAutopilotUpdate |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=FlightInputCallback |
− | |name= | + | |name=OnFlyByWire |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=Callback |
− | |name= | + | |name=OnJustAboutToBeDestroyed |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Field | {{Field | ||
− | |type= | + | |type=FlightInputCallback |
− | |name= | + | |name=OnPostAutopilotUpdate |
− | |desc= | + | |desc=? |
}} | }} | ||
− | {{ | + | {{Field |
− | {{ | + | |type=FlightInputCallback |
− | {{ | + | |name=OnPreAutopilotUpdate |
− | |returntype= | + | |desc=? |
− | |returndesc= | + | }} |
− | |name= | + | {{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〈Part〉 | ||
+ | |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〈T〉 | ||
+ | |returndesc= | ||
+ | |name=FindPartModulesImplementing〈T〉 | ||
+ | |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〈Part〉 | ||
+ | |returndesc= | ||
+ | |name=GetActiveParts | ||
+ | |args= | ||
+ | |desc=? | ||
+ | }} | ||
+ | {{Method | ||
+ | |returntype=ActiveResource | ||
+ | |returndesc= | ||
+ | |name=GetActiveResource | ||
+ | |args={{arg|PartResourceDefinition|def}} | ||
+ | |desc=? | ||
+ | }} | ||
+ | {{Method | ||
+ | |returntype=List〈ActiveResource〉 | ||
+ | |returndesc= | ||
+ | |name=GetActiveResources | ||
+ | |args= | ||
+ | |desc=? | ||
}} | }} | ||
− | {{ | + | {{Method |
− | |returntype= | + | |returntype=int |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetCrewCapacity |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=int |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetCrewCount |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Vector3 |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetFwdVector |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=float |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetHeightFromSurface |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=float |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetHeightFromTerrain |
− | |args= | + | |args= |
− | |desc= | + | |desc=The vessel's altitude above the reference body's terrain, not including liquid bodies. |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=string |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetName |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Vector3 |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetObtVelocity |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Orbit |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetOrbit |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=OrbitDriver |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetOrbitDriver |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Part |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetReferenceTransformPart |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Vector3 |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetSrfVelocity |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=VesselTargetModes |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetTargetingMode |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=float | + | |returntype=float |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetTotalMass |
− | |args= | + | |args= |
− | |desc= | + | |desc=Get the sum of the mass of all (physical) parts on this vessel |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Transform |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetTransform |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=Vessel |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GetVessel |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=List〈ProtoCrewMember〉 |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |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= | + | |returntype=Vector3d |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |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= | + | |name=GoOffRails |
− | |args= | + | |args= |
− | |desc= | + | |desc=puts the ship back into a simulated orbit and reenables physics |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=GoOnRails |
− | |args= | + | |args= |
− | |desc= | + | |desc=disables physics and puts the ship into a propagated orbit |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=bool |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=HasControlSources |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=bool |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |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= | + | |returntype=ClearToSaveStatus |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=IsClearToSave |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=Load |
− | |args= | + | |args= |
− | |desc= | + | |desc=? Has attribute [ContextMenu("Load")] |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=MakeActive |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=MakeInactive |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=MurderCrew |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=OnDestroy |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=OnLoadFlightState |
− | |args= | + | |args={{arg|Dictionary〈string, KSPParseable〉|dataPool}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=OnSaveFlightState |
− | |args= | + | |args={{arg|Dictionary〈string, KSPParseable〉|dataPool}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=double |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=PQSAltitude |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=printCollisions |
− | |args= | + | |args= |
− | |desc= | + | |desc=? Has attribute [ContextMenu("Print All Collisions")] |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=printGroundContacts |
− | |args= | + | |args= |
− | |desc= | + | |desc=? Has attribute [ContextMenu("Print Ground Contacts")] |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RenameVessel |
− | |args= | + | |args= |
− | |desc= | + | |desc=? Has attribute [ContextMenu("Rename Vessel")] |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=ResetCollisionIgnores |
− | |args= | + | |args= |
− | |desc= | + | |desc=? Has attribute [ContextMenu("Reset Collision Ignores")] |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=ResumeStaging |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=ResumeTarget |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=double |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RevealAltitude |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=float |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RevealMass |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=string |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RevealName |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=string |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RevealSituationString |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=double |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RevealSpeed |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=string |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=RevealType |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=SetActiveInternalPart |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=SetActiveInternalPart |
− | |args= | + | |args={{arg|List〈Part〉|visibleParts}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=SetActiveInternalPart |
− | |args= | + | |args={{arg|Part|visiblePart}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=SetPosition |
− | |args= | + | |args={{arg|Vector3|position}} |
− | |desc= | + | |desc=Sets the worldspace position of this vessel, and all its parts |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype= | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=SetPosition |
− | |args= | + | |args={{arg|Vector3|position}},{{arg|bool|usePristineCoords}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=SetReferenceTransform |
− | |args= | + | |args={{arg|Part|p}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |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= | + | |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= | + | |name=SpawnCrew |
− | |args= | + | |args= |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=StartFromBackup |
− | |args= | + | |args={{arg|ProtoVessel|pv}} |
− | |desc= | + | |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= | + | |name=Translate |
− | |args={{arg|Vector3| | + | |args={{arg|Vector3|offset}} |
− | |desc= | + | |desc=? |
}} | }} | ||
{{Method | {{Method | ||
− | |returntype=void | + | |returntype=void |
− | |returndesc= | + | |returndesc= |
− | |name= | + | |name=Unload |
− | |args= | + | |args= |
− | |desc= | + | |desc=? Has attribute [ContextMenu("Unload")] |
+ | }} | ||
+ | {{StaticMethod | ||
+ | |returntype=string | ||
+ | |returndesc= | ||
+ | |name=AutoRename | ||
+ | |args={{arg|Vessel|v}},{{arg|string|baseName}} | ||
+ | |desc=? | ||
}} | }} | ||
− | {{ | + | {{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 |
|
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); } ...