Kerbal Space Program  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Vessel Class Reference

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

Inheritance diagram for Vessel:
IShipconstruct ITargetable IDiscoverable

Public Types

enum  ControlLevel { ControlLevel.NONE, ControlLevel.PARTIAL_UNMANNED, ControlLevel.PARTIAL_MANNED, ControlLevel.FULL }
 
enum  Situations {
  Situations.LANDED = 1, Situations.SPLASHED = 2, Situations.PRELAUNCH = 4, Situations.FLYING = 8,
  Situations.SUB_ORBITAL = 16, Situations.ORBITING = 32, Situations.ESCAPING = 64, Situations.DOCKED = 128
}
 
enum  State { State.INACTIVE, State.ACTIVE, State.DEAD }
 

Public Member Functions

void AttachPatchedConicsSolver ()
 
ProtoVessel BackupVessel ()
 
void BuildCrossfeedPartSets ()
 
void ChangeWorldVelocity (Vector3d velOffset)
 change the worldspace velocity of this vessel More...
 
bool CheckGroundCollision ()
 
void CheckKill ()
 
bool checkLanded ()
 
bool checkSplashed ()
 
bool checkVisibility ()
 Returns true if this vessel is within the visible range of any commandable (focusable) vessel, false otherwise. More...
 
void Clean (string reason="")
 
void ClearActiveInternalSpace ()
 Sets all internal spaces in the vessel invisible More...
 
void ClearStaging ()
 
bool ContainsCollider (Collider c)
 Checks colliders on all parts to see if the given one belongs to any of them. More...
 
void CrewListSetDirty ()
 
void CycleAllAutoStrut ()
 
void DespawnCrew ()
 
void DestroyVesselComponents ()
 
void DetachPatchedConicsSolver ()
 
void Die ()
 
void FallBackReferenceTransform ()
 
void FeedInputFeed ()
 
VesselType FindDefaultVesselType ()
 
FindPartModuleImplementing< T > ()
 
List< T > FindPartModulesImplementing< T > ()
 
List< PartGetActiveParts ()
 
bool GetActiveTargetable ()
 
void GetConnectedResourceTotals (int id, out double amount, out double maxAmount, bool pulling=true)
 Gets the amount and maxamount of the given resource in the partset More...
 
void GetConnectedResourceTotals (int id, bool simulate, out double amount, out double maxAmount, bool pulling=true)
 Gets the amount and maxamount of the given resource in the partset More...
 
void GetConnectedResourceTotals (int id, out double amount, out double maxAmount, double threshold, bool pulling=true)
 Gets the amount and maxamount of the given resource in the partset, obeying threshold More...
 
void GetConnectedResourceTotals (int id, bool simulate, out double amount, out double maxAmount, double threshold, bool pulling=true)
 Gets the amount and maxamount of the given resource in the partset, obeying threshold More...
 
int GetCrewCapacity ()
 
int GetCrewCount ()
 
Orbit GetCurrentOrbit ()
 
string GetDisplayName ()
 
Vector3 GetFwdVector ()
 
float GetHeightFromSurface ()
 Get the Vessel height from the surface. Similar to GetHeightFromTerrain but checks against all surfaces. Sets heightFromSurface to the vessel height as well. Or -1 if not found. More...
 
float GetHeightFromTerrain (bool overRidePacked=false)
 Get the height of the vesselTransform from the terrain. Should only be done when vessel is loaded and unpacked. Will set heightFromTerrain to the vessel height. Or -1 if not found. More...
 
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 More...
 
Transform GetTransform ()
 
Vessel GetVessel ()
 
List< ProtoCrewMemberGetVesselCrew ()
 
Vector3d GetWorldPos3D ()
 Get a double precision vector for the vessel's worldspace position (for when transform.position isn't accurate enough) More...
 
void GoOffRails ()
 puts the ship back into a simulated orbit and reenables physics More...
 
void GoOnRails ()
 disables physics and puts the ship into a propagated orbit More...
 
bool HasValidContractObjectives (params string[] objectiveTypes)
 
bool HasValidContractObjectives (List< string > objectiveTypes, bool copy=true)
 
void IgnoreGForces (int frames)
 
bool Initialize (bool fromShipAssembly=false)
 Initialize is used in cases where the Vessel component is added to a ship that already exists. More...
 
ClearToSaveStatus IsClearToSave ()
 
bool IsFirstFrame ()
 
void KillPermanentGroundContact ()
 
void Load ()
 
void LoadVesselModules (ConfigNode node)
 
void MakeActive ()
 
void MakeInactive ()
 
void MurderCrew ()
 
void OffsetVelocity (Vector3d correction)
 
void OnDestroy ()
 
void OnLoadFlightState (Dictionary< string, KSPParseable > dataPool)
 
void OnSaveFlightState (Dictionary< string, KSPParseable > dataPool)
 
double PQSAltitude ()
 
void printCollisions ()
 
void printGroundContacts ()
 
void RebuildCrewList ()
 
void RecallReferenceTransform ()
 
bool RemoveCrew (ProtoCrewMember pcm)
 
bool RemoveCrew (string name)
 
void RemoveCrewList (List< ProtoCrewMember > pcmList, bool updatePartCount)
 
void RenameVessel ()
 
double RequestResource (Part part, int id, double demand, bool usePriority)
 Request a resource from across the vessel. More...
 
double RequestResource (Part part, int id, double demand, bool usePriority, bool simulate)
 Request a resource from across the vessel. More...
 
void ResetCollisionIgnores ()
 
void ResetGroundContact ()
 
void ResumeNavigation ()
 Method called when vessel goes active, we need to start a coroutine while we wait for the contractsystem to be loaded More...
 
void ResumeStaging ()
 
void ResumeTarget ()
 
double RevealAltitude ()
 
string RevealDisplayName ()
 
float RevealMass ()
 
string RevealName ()
 
string RevealSituationString ()
 
double RevealSpeed ()
 
string RevealType ()
 
void SetActiveInternalSpace (Part visiblePart)
 Sets the internal space for the given part visible (and all others invisible) More...
 
void SetActiveInternalSpaces (HashSet< Part > visibleParts)
 Sets the internal spaces for the given parts visible, other IVA spaces in the same vesesl become invisible More...
 
void SetAutoClean (string reason="")
 
void SetLandedAt (string landedAt, GameObject gO=null, string inputdisplaylandedAt="")
 Set the LandedAt and displaylandedAt variables. an optional GameObject and an optional inputdisplaylandedAt string can be passed in. The landedAt field will be set to the passed in landedAt string. If an inputdisplaylandedAt string is passed in then the displaylandedAt string is set to this string (Usually localized language). If the inputdisplaylandedAt is empty and a GameObject is supplied the GameObject Unity Tag will be used to lookup a MiniBiome name. If no inputdisplaylandedAt or GameObject are passed in the displaylandedAt field is set to the landedAt field. More...
 
void SetLoaded (bool loaded)
 
void SetPosition (Vector3d position)
 
void SetPosition (Vector3d position, bool usePristineCoords)
 Sets the worldspace position of this vessel, and all its parts More...
 
void SetReferenceTransform (Part p, bool storeRecall=true)
 
void SetRotation (Quaternion rotation)
 Sets the worldspace rotation of this vessel, and all its parts More...
 
void SetRotation (Quaternion rotation, bool setPos)
 Sets the worldspace rotation of this vessel, and all its parts. Accepts bool on whether to reset pos (leave false if pos is set elsewhere) More...
 
void SetWorldVelocity (Vector3d vel)
 set the absolute world velocity of this vessel More...
 
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. More...
 
void StartFromBackup (ProtoVessel pv, FlightState st)
 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. More...
 
void Translate (Vector3d offset)
 
void Unload ()
 
void UpdateAcceleration (double fdtRecip, bool fromUpdate)
 
void UpdateCaches ()
 
void UpdateDistanceTraveled ()
 Updates the distance traveled of this vessel More...
 
void UpdateLandedSplashed ()
 
void UpdatePosVel ()
 
void UpdateResourceSets ()
 Clears dirty flag and updates the vessel and the crossfeed sets More...
 
void UpdateResourceSetsIfDirty ()
 Will update only if dirty. More...
 
void UpdateVesselModuleActivation ()
 
void UpdateVesselSize ()
 Update the bounds of the vessel. More...
 

Static Public Member Functions

static string AutoRename (Vessel v, string baseName)
 
static void CrewWasModified (Vessel vessel)
 
static void CrewWasModified (Vessel vessel1, Vessel vessel2)
 
static Vessel GetDominantVessel (Vessel v1, Vessel v2)
 Find the dominant vessel on a dock situation. The dominant vessel will have the secondary merged into it. More...
 
static string GetLandedAtString (string landedAt)
 Get the landedAt string in English More...
 
static string GetMETString (Vessel v)
 
static double GetNextManeuverTime (Vessel v, out bool hasManeuver)
 
static string GetSituationString (Situations situation)
 
static string GetSituationString (Vessel v)
 Get the Situation String, Will be Localized More...
 
static bool IsValidVesselName (string name)
 

Public Attributes

Vector3d acceleration
 
double altitude
 
Vector3 angularMomentum = Vector3.zero
 
Vector3 angularVelocity = Vector3.zero
 
Vector3d angularVelocityD = Vector3d.zero
 
Vector3 CoM
 
Vector3d CoMD
 
CommNetVessel connection
 
double convectiveMachFlux
 
int crewableParts = 0
 
int crewedParts = 0
 
List< PartSetcrossfeedSets = new List<PartSet>()
 all the crossfeed (i.e. non-vessel-wide) sets on the vessel More...
 
FlightCtrlState ctrlState
 
int currentStage
 
bool directSunlight
 
string displaylandedAt = ""
 A string of where the vessel is landed in Localized language. More...
 
double distanceTraveled
 
List< PartModuledockingPorts = new List<PartModule>()
 
bool EditableNodes
 
KerbalEVA evaController
 
ConfigNode flightPlanNode
 
RUI.Algorithms.StackFlowGraph flowGraph
 a holder for the flowgraph More...
 
bool frameWasRotating = false
 
double geeForce
 
Vector3d graviticAcceleration
 
float gThresh
 
double heightFromPartOffsetLocal = 0d
 
float heightFromSurface = -1f
 
float heightFromTerrain = -1f
 
Guid id
 Unique identifier for each vessel. More...
 
Vector3d krakensbaneAcc
 
bool Landed
 
string landedAt = ""
 A string of where the vessel is landed in English. More...
 
string landedAtLast = ""
 
CelestialBody lastBody
 
double lastUT = -1
 for use in FI when checking if vessel has spent time unloaded. More...
 
Vector3d lastVel
 
double latitude
 
string launchedFrom = ""
 Will contain the Launch Site Name that this vessel launched from. If indeed it did launch from a launch site. More...
 
double launchTime
 
bool loaded = false
 
Vector3 localCoM
 This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass. More...
 
double longitude
 
double mach
 
MapObject mapObject
 
ControlLevel maxControlLevel = ControlLevel.FULL
 
double missionTime
 
Waypoint navigationWaypoint
 the active navigation waypoint for this vessel More...
 
GameObject objectUnderVessel
 
double obt_speed
 
Vector3d obt_velocity
 
FlightInputCallback OnAutopilotUpdate = (FlightCtrlState st) => { }
 
FlightInputCallback OnFlyByWire = (FlightCtrlState st) => { }
 pass the control state from the scene handler to this vessel. More...
 
Callback OnJustAboutToBeDestroyed = () => { }
 
FlightInputCallback OnPostAutopilotUpdate = (FlightCtrlState st) => { }
 
FlightInputCallback OnPreAutopilotUpdate = (FlightCtrlState st) => { }
 
OrbitDriver orbitDriver
 
OrbitRenderer orbitRenderer
 
OrbitTargeter orbitTargeter
 
bool packed
 landing / splashdown detection More...
 
double partMaxGThresh
 
List< Partparts
 
PatchedConicRenderer patchedConicRenderer
 
PatchedConicSolver patchedConicSolver
 
bool permanentGroundContact
 
uint persistentId
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
Vector3d perturbation
 
double pqsAltitude
 
int PQSmaxLevel = 0
 
int PQSminLevel = 0
 
VesselPrecalculate precalc
 
float presThresh
 
ProtoVessel protoVessel
 
ProtoTargetInfo pTI = null
 
double radarAltitude
 
Vector3 rb_velocity
 
Vector3d rb_velocityD
 
uint referenceTransformId
 
uint referenceTransformIdRecall
 
PartSet resourcePartSet
 The vessel partset. More...
 
bool resourcesDirty = false
 We set the dirty flag if we're waiting. More...
 
Part rootPart
 
List< PartSetsimulationCrossfeedSets = new List<PartSet>()
 all the Delta-V simulation crossfeed (i.e. non-vessel-wide) sets on the vessel More...
 
PartSet simulationResourcePartSet
 The vessel Delta-V simulation partset. More...
 
Situations situation
 
bool skipGroundPositioning = false
 True if this Vessel is to skip vessel ground checks. Will also be set true if the vessel was launched from a LaunchSite. If true Vessel will skip ground repositioning when coming off rails. More...
 
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) More...
 
Quaternion srfRelRotation
 
State state = State.INACTIVE
 
ITargetable targetObject
 
double terrainAltitude
 
Vector3 terrainNormal
 
double totalMass
 
Vector3d up
 
Vector3d upAxis
 
bool updateResourcesOnEvent = true
 do we update immediately on event, or wait until the end of a series of modify events (i.e. vessel instantiation or decoupling) More...
 
Vector3d velocityD
 
double verticalSpeed
 
VesselDeltaV VesselDeltaV
 This is the VesselDeltaV instance for this ShipConstruct. More...
 
List< VesselModulevesselModules = new List<VesselModule>()
 
string vesselName
 
VesselRanges vesselRanges
 
Vector3 vesselSize
 Bounds for the vessel More...
 
bool vesselSpawning = true
 True if this Vessel has just spawned into the game and hasn't had ground checks done. More...
 
Transform vesselTransform
 
VesselType vesselType = VesselType.Debris
 
double waterOffset = 0d
 

Static Public Attributes

static double HeightFromPartOffsetGlobal = 0.5d
 
static bool PartialControlHasSASRCS = true
 
static double warningThresholdG = 0.8d
 

Protected Member Functions

void onCrewTransferred (GameEvents.HostedFromToAction< ProtoCrewMember, Part > data)
 

Protected Attributes

List< ProtoCrewMembercrew = new List<ProtoCrewMember>()
 
int crewCachedPartCount = -1
 

Properties

ActionGroupList ActionGroups [get]
 
bool AutoClean [get]
 
string AutoCleanReason [get]
 
VesselAutopilot Autopilot [get]
 
Situations BestSituation [get]
 
CommNetVessel Connection [get, set]
 
Vector3 CurrentCoM [get]
 
ControlLevel CurrentControlLevel [get]
 
DiscoveryInfo DiscoveryInfo [get]
 
float distanceLandedPackThreshold [get, set]
 
float distanceLandedUnpackThreshold [get, set]
 
float distancePackThreshold [get, set]
 
float distanceUnpackThreshold [get, set]
 
Vessel EVALadderVessel [get]
 
bool HoldPhysics [get]
 
int IgnoreCollisionsFrames [get]
 
bool isActiveVessel [get]
 
bool isCommandable [get]
 
bool IsControllable [get]
 True if the vessel has at least one operational control source and is active (focused). More...
 
bool isEVA [get]
 
bool isPersistent [get, set]
 
bool IsRecoverable [get]
 
bool LandedInKSC [get]
 Returns true if vessel is landed at the KSC Launchpad or Runway. More...
 
bool LandedInStockLaunchSite [get]
 Returns true if vessel is landed at one of the stock Launch Sites. More...
 
bool LandedOrSplashed [get]
 
static float loadDistance [get, set]
 
CelestialBody mainBody [get]
 
Orbit orbit [get]
 
List< PartParts [get]
 
bool PatchedConicsAttached [get, set]
 
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. More...
 
string SituationString [get]
 Returns the Localized Vessel situation String More...
 
Part this[int index] [get]
 
Part this[uint flightID] [get]
 
static float unloadDistance [get, set]
 
VesselValues VesselValues [get]
 
- Properties inherited from IShipconstruct
List< PartParts [get]
 
- Properties inherited from IDiscoverable
DiscoveryInfo DiscoveryInfo [get]
 

Detailed Description

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

Member Enumeration Documentation

Enumerator
NONE 
PARTIAL_UNMANNED 
PARTIAL_MANNED 
FULL 
Enumerator
LANDED 
SPLASHED 
PRELAUNCH 
FLYING 
SUB_ORBITAL 
ORBITING 
ESCAPING 
DOCKED 
Enumerator
INACTIVE 
ACTIVE 
DEAD 

Member Function Documentation

void Vessel.AttachPatchedConicsSolver ( )
inline
static string Vessel.AutoRename ( Vessel  v,
string  baseName 
)
inlinestatic
ProtoVessel Vessel.BackupVessel ( )
inline
void Vessel.BuildCrossfeedPartSets ( )
inline
void Vessel.ChangeWorldVelocity ( Vector3d  velOffset)
inline

change the worldspace velocity of this vessel

Parameters
vel
bool Vessel.CheckGroundCollision ( )
inline
void Vessel.CheckKill ( )
inline
bool Vessel.checkLanded ( )
inline
bool Vessel.checkSplashed ( )
inline
bool Vessel.checkVisibility ( )
inline

Returns true if this vessel is within the visible range of any commandable (focusable) vessel, false otherwise.

void Vessel.Clean ( string  reason = "")
inline
void Vessel.ClearActiveInternalSpace ( )
inline

Sets all internal spaces in the vessel invisible

void Vessel.ClearStaging ( )
inline
bool Vessel.ContainsCollider ( Collider  c)
inline

Checks colliders on all parts to see if the given one belongs to any of them.

Parameters
c
Returns
void Vessel.CrewListSetDirty ( )
inline
static void Vessel.CrewWasModified ( Vessel  vessel)
inlinestatic
static void Vessel.CrewWasModified ( Vessel  vessel1,
Vessel  vessel2 
)
inlinestatic
void Vessel.CycleAllAutoStrut ( )
inline

< Cycle any auto-struts

void Vessel.DespawnCrew ( )
inline
void Vessel.DestroyVesselComponents ( )
inline
void Vessel.DetachPatchedConicsSolver ( )
inline
void Vessel.Die ( )
inline
void Vessel.FallBackReferenceTransform ( )
inline
void Vessel.FeedInputFeed ( )
inline
VesselType Vessel.FindDefaultVesselType ( )
inline
T Vessel.FindPartModuleImplementing< T > ( )
inline
Type Constraints
T :class 
List<T> Vessel.FindPartModulesImplementing< T > ( )
inline
Type Constraints
T :class 
List<Part> Vessel.GetActiveParts ( )
inline
bool Vessel.GetActiveTargetable ( )
inline

Implements ITargetable.

void Vessel.GetConnectedResourceTotals ( int  id,
out double  amount,
out double  maxAmount,
bool  pulling = true 
)
inline

Gets the amount and maxamount of the given resource in the partset

Parameters
idthe hash of the resource
amountavailable amount will be stored here (will be headroom if pulling==false)
maxAmountmax possible amount will be stored here
pullingare we planning to push or pull resources from the parts
void Vessel.GetConnectedResourceTotals ( int  id,
bool  simulate,
out double  amount,
out double  maxAmount,
bool  pulling = true 
)
inline

Gets the amount and maxamount of the given resource in the partset

Parameters
idthe hash of the resource
simulateSet to true to use the simulationResourcePartSet
amountavailable amount will be stored here (will be headroom if pulling==false)
maxAmountmax possible amount will be stored here
pullingare we planning to push or pull resources from the parts
void Vessel.GetConnectedResourceTotals ( int  id,
out double  amount,
out double  maxAmount,
double  threshold,
bool  pulling = true 
)
inline

Gets the amount and maxamount of the given resource in the partset, obeying threshold

Parameters
idthe hash of the resource
amountavailable amount will be stored here (will be headroom if pulling==false)
maxAmount>max possible amount will be stored here
threshold
pullingare we planning to push or pull resources from the parts
void Vessel.GetConnectedResourceTotals ( int  id,
bool  simulate,
out double  amount,
out double  maxAmount,
double  threshold,
bool  pulling = true 
)
inline

Gets the amount and maxamount of the given resource in the partset, obeying threshold

Parameters
idthe hash of the resource
simulateSet to true to use the simulationResourcePartSet
amountavailable amount will be stored here (will be headroom if pulling==false)
maxAmount>max possible amount will be stored here
threshold
pullingare we planning to push or pull resources from the parts
int Vessel.GetCrewCapacity ( )
inline
int Vessel.GetCrewCount ( )
inline
Orbit Vessel.GetCurrentOrbit ( )
inline
string Vessel.GetDisplayName ( )
inline

Implements ITargetable.

static Vessel Vessel.GetDominantVessel ( Vessel  v1,
Vessel  v2 
)
inlinestatic

Find the dominant vessel on a dock situation. The dominant vessel will have the secondary merged into it.

Parameters
v1
v2
Returns
Vector3 Vessel.GetFwdVector ( )
inline

Implements ITargetable.

float Vessel.GetHeightFromSurface ( )
inline

Get the Vessel height from the surface. Similar to GetHeightFromTerrain but checks against all surfaces. Sets heightFromSurface to the vessel height as well. Or -1 if not found.

Returns
the vessel height from the surface
float Vessel.GetHeightFromTerrain ( bool  overRidePacked = false)
inline

Get the height of the vesselTransform from the terrain. Should only be done when vessel is loaded and unpacked. Will set heightFromTerrain to the vessel height. Or -1 if not found.

Parameters
overRidePackedIf true will override the Vessel.packed check.
Returns
the vessel height
static string Vessel.GetLandedAtString ( string  landedAt)
inlinestatic

Get the landedAt string in English

Parameters
landedAt
Returns
LandedAt string in English with spaces
static string Vessel.GetMETString ( Vessel  v)
inlinestatic
string Vessel.GetName ( )
inline

Implements ITargetable.

static double Vessel.GetNextManeuverTime ( Vessel  v,
out bool  hasManeuver 
)
inlinestatic

< Generally this is only loaded vessels, but just check for the presence of a solver to allow it to fallback on the flightPlanNode.

Vector3 Vessel.GetObtVelocity ( )
inline

Implements ITargetable.

Orbit Vessel.GetOrbit ( )
inline

Implements ITargetable.

OrbitDriver Vessel.GetOrbitDriver ( )
inline

Implements ITargetable.

Part Vessel.GetReferenceTransformPart ( )
inline
static string Vessel.GetSituationString ( Situations  situation)
inlinestatic
static string Vessel.GetSituationString ( Vessel  v)
inlinestatic

Get the Situation String, Will be Localized

Parameters
v
Returns
Vector3 Vessel.GetSrfVelocity ( )
inline

Implements ITargetable.

VesselTargetModes Vessel.GetTargetingMode ( )
inline

Implements ITargetable.

float Vessel.GetTotalMass ( )
inline

Get the sum of the mass of all (physical) parts on this vessel

Returns

< if (p.physicalSignificance != Part.PhysicalSignificance.FULL) continue;

< CJ Adding resources Support

Transform Vessel.GetTransform ( )
inline

Implements ITargetable.

Vessel Vessel.GetVessel ( )
inline

Implements ITargetable.

List<ProtoCrewMember> Vessel.GetVesselCrew ( )
inline
Vector3d Vessel.GetWorldPos3D ( )
inline

Get a double precision vector for the vessel's worldspace position (for when transform.position isn't accurate enough)

Returns
void Vessel.GoOffRails ( )
inline

puts the ship back into a simulated orbit and reenables physics

< can't unpack unloaded vessels

< don't unpack landed vessels if the planet is actually spinning.

void Vessel.GoOnRails ( )
inline

disables physics and puts the ship into a propagated orbit

bool Vessel.HasValidContractObjectives ( params string[]  objectiveTypes)
inline
bool Vessel.HasValidContractObjectives ( List< string >  objectiveTypes,
bool  copy = true 
)
inline
void Vessel.IgnoreGForces ( int  frames)
inline
bool Vessel.Initialize ( bool  fromShipAssembly = false)
inline

Initialize is used in cases where the Vessel component is added to a ship that already exists.

Parameters
fromShipAssemblyset to true if Vessel is being initialized from a ShipAssembly (ShipConstruct) to Launch. Sets vessel position and orbit differently
ClearToSaveStatus Vessel.IsClearToSave ( )
inline
bool Vessel.IsFirstFrame ( )
inline
static bool Vessel.IsValidVesselName ( string  name)
inlinestatic
void Vessel.KillPermanentGroundContact ( )
inline
void Vessel.Load ( )
inline

< correct altitude based on PQS nominal height for the current lat/lon

void Vessel.LoadVesselModules ( ConfigNode  node)
inline
void Vessel.MakeActive ( )
inline
void Vessel.MakeInactive ( )
inline

< Kill any targeting.

void Vessel.MurderCrew ( )
inline
void Vessel.OffsetVelocity ( Vector3d  correction)
inline
void Vessel.onCrewTransferred ( GameEvents.HostedFromToAction< ProtoCrewMember, Part data)
inlineprotected
void Vessel.OnDestroy ( )
inline
void Vessel.OnLoadFlightState ( Dictionary< string, KSPParseable dataPool)
inline
void Vessel.OnSaveFlightState ( Dictionary< string, KSPParseable dataPool)
inline
double Vessel.PQSAltitude ( )
inline
void Vessel.printCollisions ( )
inline
void Vessel.printGroundContacts ( )
inline
void Vessel.RebuildCrewList ( )
inline
void Vessel.RecallReferenceTransform ( )
inline
bool Vessel.RemoveCrew ( ProtoCrewMember  pcm)
inline
bool Vessel.RemoveCrew ( string  name)
inline
void Vessel.RemoveCrewList ( List< ProtoCrewMember pcmList,
bool  updatePartCount 
)
inline

< We'll track how many crew we remove from the main list

void Vessel.RenameVessel ( )
inline
double Vessel.RequestResource ( Part  part,
int  id,
double  demand,
bool  usePriority 
)
inline

Request a resource from across the vessel.

Parameters
partThe part requesting the pull/push of the resource
idthe hash of the resource
demandthe demand in units, positive means draw (pull), negative means push
usePrioritydraw in staging order
Returns
double Vessel.RequestResource ( Part  part,
int  id,
double  demand,
bool  usePriority,
bool  simulate 
)
inline

Request a resource from across the vessel.

Parameters
partThe part requesting the pull/push of the resource
idthe hash of the resource
demandthe demand in units, positive means draw (pull), negative means push
usePrioritydraw in staging order
simulateSet to true to use the simulationResourcePartSet
Returns
void Vessel.ResetCollisionIgnores ( )
inline
void Vessel.ResetGroundContact ( )
inline
void Vessel.ResumeNavigation ( )
inline

Method called when vessel goes active, we need to start a coroutine while we wait for the contractsystem to be loaded

void Vessel.ResumeStaging ( )
inline
void Vessel.ResumeTarget ( )
inline
double Vessel.RevealAltitude ( )
inline

Implements IDiscoverable.

string Vessel.RevealDisplayName ( )
inline

Implements IDiscoverable.

float Vessel.RevealMass ( )
inline

Implements IDiscoverable.

string Vessel.RevealName ( )
inline

Implements IDiscoverable.

string Vessel.RevealSituationString ( )
inline

Implements IDiscoverable.

double Vessel.RevealSpeed ( )
inline

Implements IDiscoverable.

string Vessel.RevealType ( )
inline

Implements IDiscoverable.

void Vessel.SetActiveInternalSpace ( Part  visiblePart)
inline

Sets the internal space for the given part visible (and all others invisible)

Parameters
visiblePart
void Vessel.SetActiveInternalSpaces ( HashSet< Part visibleParts)
inline

Sets the internal spaces for the given parts visible, other IVA spaces in the same vesesl become invisible

Parameters
visibleParts
void Vessel.SetAutoClean ( string  reason = "")
inline
void Vessel.SetLandedAt ( string  landedAt,
GameObject  gO = null,
string  inputdisplaylandedAt = "" 
)
inline

Set the LandedAt and displaylandedAt variables. an optional GameObject and an optional inputdisplaylandedAt string can be passed in. The landedAt field will be set to the passed in landedAt string. If an inputdisplaylandedAt string is passed in then the displaylandedAt string is set to this string (Usually localized language). If the inputdisplaylandedAt is empty and a GameObject is supplied the GameObject Unity Tag will be used to lookup a MiniBiome name. If no inputdisplaylandedAt or GameObject are passed in the displaylandedAt field is set to the landedAt field.

Parameters
landedAt
gO
inputdisplaylandedAt
void Vessel.SetLoaded ( bool  loaded)
inline
void Vessel.SetPosition ( Vector3d  position)
inline
void Vessel.SetPosition ( Vector3d  position,
bool  usePristineCoords 
)
inline

Sets the worldspace position of this vessel, and all its parts

Parameters
position

< physicsless parts will be moved along with their parents

void Vessel.SetReferenceTransform ( Part  p,
bool  storeRecall = true 
)
inline

< unset the ref transform id if setting a null transform.

void Vessel.SetRotation ( Quaternion  rotation)
inline

Sets the worldspace rotation of this vessel, and all its parts

Parameters
rotation
void Vessel.SetRotation ( Quaternion  rotation,
bool  setPos 
)
inline

Sets the worldspace rotation of this vessel, and all its parts. Accepts bool on whether to reset pos (leave false if pos is set elsewhere)

Parameters
rotation
void Vessel.SetWorldVelocity ( Vector3d  vel)
inline

set the absolute world velocity of this vessel

Parameters
vel
void Vessel.SpawnCrew ( )
inline
void Vessel.StartFromBackup ( ProtoVessel  pv)
inline

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.

Parameters
pvThe Protovessel object for this vessel
void Vessel.StartFromBackup ( ProtoVessel  pv,
FlightState  st 
)
inline

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.

Parameters
pvThe Protovessel object for this vessel
stThe flightstate
void Vessel.Translate ( Vector3d  offset)
inline
void Vessel.Unload ( )
inline
void Vessel.UpdateAcceleration ( double  fdtRecip,
bool  fromUpdate 
)
inline

< If we're not dead and we have the engines on, then let's compute an estimated acceleration from engines.

void Vessel.UpdateCaches ( )
inline

< do data transmitter thingie here

void Vessel.UpdateDistanceTraveled ( )
inline

Updates the distance traveled of this vessel

void Vessel.UpdateLandedSplashed ( )
inline
void Vessel.UpdatePosVel ( )
inline

< use CoM, not root part

< Pythagorean idea thanks to suggestion from Toadicus on modders' corner tracker. And it's even faster than the old trig version, too!

void Vessel.UpdateResourceSets ( )
inline

Clears dirty flag and updates the vessel and the crossfeed sets

void Vessel.UpdateResourceSetsIfDirty ( )
inline

Will update only if dirty.

void Vessel.UpdateVesselModuleActivation ( )
inline
void Vessel.UpdateVesselSize ( )
inline

Update the bounds of the vessel.

Member Data Documentation

Vector3d Vessel.acceleration
double Vessel.altitude
Vector3 Vessel.angularMomentum = Vector3.zero
Vector3 Vessel.angularVelocity = Vector3.zero
Vector3d Vessel.angularVelocityD = Vector3d.zero
Vector3 Vessel.CoM
Vector3d Vessel.CoMD
CommNetVessel Vessel.connection
double Vessel.convectiveMachFlux
List<ProtoCrewMember> Vessel.crew = new List<ProtoCrewMember>()
protected
int Vessel.crewableParts = 0
int Vessel.crewCachedPartCount = -1
protected
int Vessel.crewedParts = 0
List<PartSet> Vessel.crossfeedSets = new List<PartSet>()

all the crossfeed (i.e. non-vessel-wide) sets on the vessel

FlightCtrlState Vessel.ctrlState
int Vessel.currentStage
bool Vessel.directSunlight
string Vessel.displaylandedAt = ""

A string of where the vessel is landed in Localized language.

double Vessel.distanceTraveled
List<PartModule> Vessel.dockingPorts = new List<PartModule>()
bool Vessel.EditableNodes
KerbalEVA Vessel.evaController
ConfigNode Vessel.flightPlanNode

a holder for the flowgraph

bool Vessel.frameWasRotating = false
double Vessel.geeForce
Vector3d Vessel.graviticAcceleration
float Vessel.gThresh
double Vessel.HeightFromPartOffsetGlobal = 0.5d
static
double Vessel.heightFromPartOffsetLocal = 0d
float Vessel.heightFromSurface = -1f
float Vessel.heightFromTerrain = -1f
Guid Vessel.id

Unique identifier for each vessel.

Vector3d Vessel.krakensbaneAcc
bool Vessel.Landed
string Vessel.landedAt = ""

A string of where the vessel is landed in English.

string Vessel.landedAtLast = ""
CelestialBody Vessel.lastBody
double Vessel.lastUT = -1

for use in FI when checking if vessel has spent time unloaded.

Vector3d Vessel.lastVel
double Vessel.latitude
string Vessel.launchedFrom = ""

Will contain the Launch Site Name that this vessel launched from. If indeed it did launch from a launch site.

double Vessel.launchTime
bool Vessel.loaded = false
Vector3 Vessel.localCoM

This is used for persistence purposes. Use findLocalCenterOfMass() if you just want the center of mass.

double Vessel.longitude
double Vessel.mach
MapObject Vessel.mapObject
ControlLevel Vessel.maxControlLevel = ControlLevel.FULL
double Vessel.missionTime
Waypoint Vessel.navigationWaypoint

the active navigation waypoint for this vessel

GameObject Vessel.objectUnderVessel
double Vessel.obt_speed
Vector3d Vessel.obt_velocity
FlightInputCallback Vessel.OnAutopilotUpdate = (FlightCtrlState st) => { }
FlightInputCallback Vessel.OnFlyByWire = (FlightCtrlState st) => { }

pass the control state from the scene handler to this vessel.

Callback Vessel.OnJustAboutToBeDestroyed = () => { }
FlightInputCallback Vessel.OnPostAutopilotUpdate = (FlightCtrlState st) => { }
FlightInputCallback Vessel.OnPreAutopilotUpdate = (FlightCtrlState st) => { }
OrbitDriver Vessel.orbitDriver
OrbitRenderer Vessel.orbitRenderer
OrbitTargeter Vessel.orbitTargeter
bool Vessel.packed

landing / splashdown detection

bool Vessel.PartialControlHasSASRCS = true
static
double Vessel.partMaxGThresh
List<Part> Vessel.parts
PatchedConicRenderer Vessel.patchedConicRenderer
PatchedConicSolver Vessel.patchedConicSolver
bool Vessel.permanentGroundContact
uint Vessel.persistentId

A unique identifier for each vessel including from when it was Shipconstruct

Vector3d Vessel.perturbation
double Vessel.pqsAltitude
int Vessel.PQSmaxLevel = 0
int Vessel.PQSminLevel = 0
VesselPrecalculate Vessel.precalc
float Vessel.presThresh
ProtoVessel Vessel.protoVessel
ProtoTargetInfo Vessel.pTI = null
double Vessel.radarAltitude
Vector3 Vessel.rb_velocity
Vector3d Vessel.rb_velocityD
uint Vessel.referenceTransformId
uint Vessel.referenceTransformIdRecall
PartSet Vessel.resourcePartSet

The vessel partset.

bool Vessel.resourcesDirty = false

We set the dirty flag if we're waiting.

Part Vessel.rootPart
List<PartSet> Vessel.simulationCrossfeedSets = new List<PartSet>()

all the Delta-V simulation crossfeed (i.e. non-vessel-wide) sets on the vessel

PartSet Vessel.simulationResourcePartSet

The vessel Delta-V simulation partset.

Situations Vessel.situation
bool Vessel.skipGroundPositioning = false

True if this Vessel is to skip vessel ground checks. Will also be set true if the vessel was launched from a LaunchSite. If true Vessel will skip ground repositioning when coming off rails.

double Vessel.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)

Quaternion Vessel.srfRelRotation
State Vessel.state = State.INACTIVE
ITargetable Vessel.targetObject
double Vessel.terrainAltitude
Vector3 Vessel.terrainNormal
double Vessel.totalMass
Vector3d Vessel.up
Vector3d Vessel.upAxis
bool Vessel.updateResourcesOnEvent = true

do we update immediately on event, or wait until the end of a series of modify events (i.e. vessel instantiation or decoupling)

Vector3d Vessel.velocityD
double Vessel.verticalSpeed
VesselDeltaV Vessel.VesselDeltaV

This is the VesselDeltaV instance for this ShipConstruct.

List<VesselModule> Vessel.vesselModules = new List<VesselModule>()
string Vessel.vesselName
VesselRanges Vessel.vesselRanges
Vector3 Vessel.vesselSize

Bounds for the vessel

bool Vessel.vesselSpawning = true

True if this Vessel has just spawned into the game and hasn't had ground checks done.

Transform Vessel.vesselTransform
VesselType Vessel.vesselType = VesselType.Debris
double Vessel.warningThresholdG = 0.8d
static
double Vessel.waterOffset = 0d

Property Documentation

ActionGroupList Vessel.ActionGroups
get
bool Vessel.AutoClean
get
string Vessel.AutoCleanReason
get
VesselAutopilot Vessel.Autopilot
get
Situations Vessel.BestSituation
get
CommNetVessel Vessel.Connection
getset
Vector3 Vessel.CurrentCoM
get
ControlLevel Vessel.CurrentControlLevel
get
DiscoveryInfo Vessel.DiscoveryInfo
get
float Vessel.distanceLandedPackThreshold
getset
float Vessel.distanceLandedUnpackThreshold
getset
float Vessel.distancePackThreshold
getset
float Vessel.distanceUnpackThreshold
getset
Vessel Vessel.EVALadderVessel
get
bool Vessel.HoldPhysics
get
int Vessel.IgnoreCollisionsFrames
get
bool Vessel.isActiveVessel
get
bool Vessel.isCommandable
get
bool Vessel.IsControllable
get

True if the vessel has at least one operational control source and is active (focused).

bool Vessel.isEVA
get
bool Vessel.isPersistent
getset
bool Vessel.IsRecoverable
get
bool Vessel.LandedInKSC
get

Returns true if vessel is landed at the KSC Launchpad or Runway.

bool Vessel.LandedInStockLaunchSite
get

Returns true if vessel is landed at one of the stock Launch Sites.

bool Vessel.LandedOrSplashed
get
float Vessel.loadDistance
staticgetset
CelestialBody Vessel.mainBody
get
Orbit Vessel.orbit
get
List<Part> Vessel.Parts
get
bool Vessel.PatchedConicsAttached
getset
Transform Vessel.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.

string Vessel.SituationString
get

Returns the Localized Vessel situation String

Part Vessel.this[int index]
get
Part Vessel.this[uint flightID]
get
float Vessel.unloadDistance
staticgetset
VesselValues Vessel.VesselValues
get

The documentation for this class was generated from the following file: