Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ModuleRCS Class Reference
Inheritance diagram for ModuleRCS:
PartModule IResourceConsumer ITorqueProvider IConstruction ModuleRCSFX

Public Member Functions

float CalculateThrust (float totalForce, out bool success)
 
virtual bool CanBeDetached ()
 Returns true if not active. More...
 
virtual bool CanBeOffset ()
 Returns true if not active. More...
 
virtual bool CanBeRotated ()
 Returns true if not active. More...
 
virtual void DeactivateFX ()
 
virtual void DeactivatePowerFX ()
 
void FixedUpdate ()
 
List< PartResourceDefinitionGetConsumedResources ()
 
override string GetInfo ()
 Returns formatted string of additional data for use in the VAB and SPH More...
 
float GetLeverDistance (Transform trf, Vector3 axis, Vector3 leverPivotPosition)
 
float GetLeverDistanceOriginal (Vector3 leverPivotPosition)
 
override string GetModuleDisplayName ()
 Override this to provide a Localized version of the PartModules Name for UI components More...
 
void GetPotentialTorque (out Vector3 pos, out Vector3 neg)
 
override string GetStagingDisableText ()
 
override string GetStagingEnableText ()
 
override bool IsStageable ()
 Should this module be counted when seeing whether to have a stack icon present? Override in a module for custom behavior; otherwise returns true if the module (or something the module inherits from above PartModule itself) overrides OnActive() More...
 
override void OnActive ()
 Called when the part is set active (after unpacking etc) More...
 
override void OnAwake ()
 Method fires once the module has been added to the part. Use for first time setup. Module will not have loaded fully by this point More...
 
override void OnLoad (ConfigNode node)
 Use OnLoad to load any additional data from the ConfigNode provided More...
 
override void OnModuleAdjusterRemoved (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is removed. More...
 
override void OnStart (PartModule.StartState state)
 
double RequestPropellant (double mass)
 
void SetResource (string resource)
 
void SetupPropellant (ConfigNode node)
 
void ToggleAction (KSPActionParam param)
 
void ToggleToggles ()
 
void Update ()
 
- Public Member Functions inherited from PartModule
void AddPartModuleAdjuster (AdjusterPartModuleBase newAdjuster)
 Call this to add an adjuster to this part module. More...
 
void AddPartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Applies the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
bool AppliedUpgrades ()
 Returns true if upgrades are applied More...
 
void ApplyAdjustersOnStart ()
 Called when a part module is loaded and applies all of the currently loaded adjusters. More...
 
virtual void ApplyUpgradeNode (List< string > appliedUps, ConfigNode node, bool doLoad)
 Applies the upgrades to a confignode. Will either copy the upgrades back to the node or (if doLoad) calls load/onload on it. More...
 
virtual bool ApplyUpgrades (StartState state)
 Will find and apply upgrades. Called during Part's ModulesOnStart, before a module's OnStart. More...
 
void Awake ()
 
delegate bool boolPMApplyUpgrades (PartModule pm, StartState state)
 
delegate bool boolPMBoolDelegate (PartModule pm, bool apply)
 
void ClearPersistentId ()
 Clear the modules persistentId More...
 
void Copy (PartModule fromModule)
 
virtual void DemoteToPhysicslessPart ()
 This method will be called from Part class DemoteToPhysicslessPart when the part is being converted from physical to physicsless part. It is called before the joints and rigidbodies are destroyed. More...
 
virtual bool FindUpgrades (bool fillApplied, ConfigNode node=null)
 Find applicable upgrades to the partmodule (isunlocked and isenabled) and add to the upgradesApplied list. Pass true if you want to add the upgrades to upgradesApplied, false if you just want to know if at least one upgrade is applicable (unlocked rather than enabled) More...
 
virtual Color GetCurrentColor ()
 Returns the current part module color. More...
 
virtual Color GetCurrentColor (string fieldName)
 Returns the current part module color for a field where usespe. More...
 
uint GetPersistenActiontId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
uint GetPersistentId ()
 Get the modules persistentID, and create one if it doesnt already have one More...
 
virtual string GetUpgradeInfo ()
 Called by Upgrade Stats dialog More...
 
bool HasUpgrades ()
 Returns true if upgrades exist for the partmodule More...
 
bool IsValidContractObjective (string objectiveType)
 Returns if, for example, an antenna part module qualifies as an antenna for contracts. More...
 
void Load (ConfigNode node)
 
virtual void LoadUpgrades (ConfigNode node)
 Loads module-relevant upgrades from the partmodule confignode More...
 
uint NewPersistentId ()
 Reset the modules persistentId to a new number More...
 
virtual void OnColorChanged (Color color)
 Meant to be overwritten by part modules implementing color changes. In this case, it doesn't matter which color picker changed specifically. More...
 
virtual void OnColorChanged (Color color, string pickerID="")
 Meant to be overwritten by part modules implementing color changes More...
 
virtual void OnConstructionModeFixedUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every FixedUpdate(). More...
 
virtual void OnConstructionModeUpdate ()
 This method will be called when in EVA Construction mode and this part and itself is disabled (when it is not attached to a vessel) every Update(). More...
 
virtual void OnCopy (PartModule fromModule)
 Use OnCopy to copy any additional data from the PartModule provided More...
 
virtual void OnFixedUpdate ()
 Called every physics/fixed frame that the part is active More...
 
virtual void OnIconCreate ()
 Method fires just before components are stripped from the gameobject to make it an icon. (The part is instantiated and then various components like Part, PartModule, EffectBehaviour, Colliders, Particles, etc are stripped and then it's set as the icon prefab. This lets PartModules do stuff to the model right before that happens. More...
 
virtual void OnInactive ()
 Called before the part goes inactive (after packing etc) More...
 
virtual void OnInitialize ()
 Called on all modules after all parts are loaded but before they give the ship to the game More...
 
virtual void OnInventoryModeDisable ()
 This method will be called when this modules part and itself is first disabled (when it is not attached to a vessel) when created in Inventory/Construction mode. More...
 
virtual void OnInventoryModeEnable ()
 This method will be called when this modules part and itself is first enabled (when it is attached to a vessel) when created in Inventory/Construction mode. More...
 
void OnModuleAdjusterAddedWrapper (AdjusterPartModuleBase adjuster)
 Wrapper to check the mission expansion availability before performing processing specific to this part module when an adjuster is added. More...
 
virtual void OnPartCreatedFomInventory (ModuleInventoryPart moduleInventoryPart)
 This method is called when a part is being taken out from a slot while being in EVAConstruction mode. More...
 
virtual void OnSave (ConfigNode node)
 Use OnSave to serialize additional module information into the ConfigNode provided More...
 
virtual void OnStart (StartState state)
 Called when the part starts. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStartBeforePartAttachJoint (StartState state)
 Called in flight scene in Part.Start just before the Part attachnode joints are created. More...
 
virtual void OnStartFinished (StartState state)
 Called when the part finishes starting. The StartState gives an indication of where in flight you are. All values may not be plugged in! More...
 
virtual void OnStoredInInventory (ModuleInventoryPart moduleInventoryPart)
 Called when the part is stored in an inventory. More...
 
virtual void OnUpdate ()
 Called every frame that the part is active More...
 
virtual void OnWasCopied (PartModule copyPartModule, bool asSymCounterpart)
 Called when the PartModule was copied, through Alt+Copy or symmetry More...
 
virtual void OnWillBeCopied (bool asSymCounterpart)
 Called when the PartModule is about to be copied, through Alt+Copy or symmetry More...
 
virtual bool OnWillBeMirrored (ref Quaternion rotation, AttachNode selPartNode, Part partParent)
 This is called in the Editor scene when a symmetry copy of a part is being positioned. Only called on the symmetry parts and only when symmetry mode is set to Mirror. It allows the mirror rotation to be changed and returned before being applied to the symmetry copy part.

Parameters
rotationThe current calculated rotation. Will be updated if method returns true.
selPartNodeThe attachnode.
partParentThe part that will become this part's parent.
Returns
True if the rotation was changed. Otherwise will return false.
More...
 
virtual List< Color > PresetColors ()
 Preset colors received for any part module. By default, returns only black, override to make your own selection. More...
 
virtual string PrintUpgrades ()
 
virtual void PromoteToPhysicalPart ()
 This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part. More...
 
void RemovePartModuleAdjuster (AdjusterPartModuleBase oldAdjuster)
 Call this to remove an adjuster from this part module. More...
 
void RemovePartModuleAdjusterList (List< AdjusterPartModuleBase > moduleAdjusters)
 Removes the appropriate module adjusters. Performs checks to make sure that the adjusters are valid too. More...
 
void Save (ConfigNode node)
 
virtual void SetStaging (bool newValue)
 Run by the part's staging toggle handler, sets staging on modules on symmetry counterparts. More...
 
void SetStagingState (bool newState)
 Set the staging enabled bool for this module. More...
 
virtual bool StagingEnabled ()
 Gets current staging status (is staging enabled for this module) Override me! More...
 
virtual bool StagingToggleEnabledEditor ()
 
virtual bool StagingToggleEnabledFlight ()
 
void ToggleStaging ()
 
virtual void UpdateStagingToggle ()
 Updates the staging toggle More...
 
delegate void voidPMApplyNodeDelegate (PartModule pm, List< string > appliedUps, ConfigNode node, bool doLoad)
 
delegate void voidPMDelegate (PartModule pm)
 
delegate void voidPMNodeDelegate (PartModule pm, ConfigNode node)
 

Public Attributes

FloatCurve atmosphereCurve
 a curve to determine loss or gain of thrust due to changes in atmosphere vs vacuum values are based on ISP to ATM Pressure More...
 
bool currentShowToggles = false
 
bool enablePitch = true
 
bool enableRoll = true
 
bool enableX = true
 
bool enableY = true
 
bool enableYaw = true
 
bool enableZ = true
 
float EPSILON = 0.05f
 Minimum latch for thrust. Is predominantly uses as Epsilon ^ 2 in comparisons More...
 
bool flameout = false
 
double flowMult = 1d
 
bool fullThrust = false
 always use full thrust More...
 
float fullThrustMin = 0.2f
 if thrust amount from dots < this, don't do full thrust More...
 
Vector3 fxOffset = Vector3.zero
 
Vector3 fxOffsetRot = Vector3.zero
 
string fxPrefabName = "fx_gasJet_white"
 
string fxPrefix = "rcsGroup"
 
double G = 9.80665d
 
bool isJustForShow = false
 
double ispMult = 1d
 
double maxFuelFlow = 0d
 
double mixtureDensity
 What is the density of the mixture. More...
 
double mixtureDensityRecip
 
float precisionFactor = 0.1f
 
List< Propellantpropellants
 
bool rcs_active
 
bool rcsEnabled = true
 
float realISP = 0.0f
 
bool requiresFuel = true
 
string resourceFlowMode = "STAGE_PRIORITY_FLOW"
 
string resourceName = "MonoPropellant"
 
bool shieldedCanThrust = false
 
bool showToggles = true
 
FloatCurve thrustCurve = new FloatCurve()
 The curve to use More...
 
float thrustCurveDisplay = 1f
 
float thrustCurveRatio = 1f
 
List< FXGroupthrusterFX
 
float thrusterPower = 1.0f
 
string thrusterTransformName = "RCSthruster"
 
List< Transform > thrusterTransforms
 
float[] thrustForces
 
float thrustPercentage = 100f
 
bool useLever = true
 
bool useThrottle = false
 
bool useThrustCurve = false
 should we use a thrust curve (based on resource remaining) ? More...
 
bool useZaxis = false
 
- Public Attributes inherited from PartModule
bool isEnabled = true
 
bool moduleIsEnabled = true
 
string moduleName
 
bool overrideStagingIconIfBlank = true
 
ModuleResourceHandler resHandler = new ModuleResourceHandler()
 
bool showUpgradesInModuleInfo = false
 
ProtoPartModuleSnapshot snapshot
 
string stagingDisableText = ""
 
bool stagingEnabled = true
 
string stagingEnableText = ""
 
bool stagingToggleEnabledEditor = false
 
bool stagingToggleEnabledFlight = false
 
List< ConfigNodeupgrades
 
List< string > upgradesApplied = new List<string>()
 
bool upgradesApply = true
 
bool upgradesAsk = true
 

Protected Member Functions

Vector3 ApplyInputLinearAdjustments (Vector3 inputLinear)
 
Vector3 ApplyInputRotationAdjustments (Vector3 inputRotation)
 
bool IsAdjusterBreakingRCS ()
 
override void OnModuleAdjusterAdded (AdjusterPartModuleBase adjuster)
 Perform processing specific to this part module when an adjuster is added. More...
 
virtual void SetupFX ()
 
virtual void UpdatePowerFX (bool running, int idx, float power)
 
- Protected Member Functions inherited from PartModule
ConfigNode GetUpgrade (string name)
 
virtual void LoadUpgradesApplied (List< string > applieds, ConfigNode node)
 Load the applied upgrade names More...
 
virtual void SaveUpgradesApplied (ConfigNode node)
 Save the applied upgrades. More...
 
IEnumerator UpgradeWaitForScenarioModules ()
 

Protected Attributes

Dictionary< Propellant,
KSP.UI.Screens.ProtoStageIconInfo
PropellantGauges
 
int tC
 

Additional Inherited Members

- Public Types inherited from PartModule
enum  PartUpgradeState { PartUpgradeState.NONE, PartUpgradeState.LOCKED, PartUpgradeState.AVAILABLE }
 
enum  StartState {
  StartState.None = 0, StartState.Editor = 1, StartState.PreLaunch = 2, StartState.Landed = 4,
  StartState.Docked = 8, StartState.Flying = 16, StartState.Splashed = 32, StartState.SubOrbital = 64,
  StartState.Orbital = 128
}
 
- Static Public Member Functions inherited from PartModule
static ReflectedAttributes GetReflectedAttributes (Type partModuleType)
 
static PartUpgradeState UpgradesAvailable (Part part)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
static PartUpgradeState UpgradesAvailable (Part part, ConfigNode node)
 Returns true if at least one module on the part has at least one upgrade available (isUnlocked) More...
 
- Static Public Attributes inherited from PartModule
static voidPMApplyNodeDelegate ApplyUpgradeNodeDel
 
static boolPMApplyUpgrades ApplyUpgradesDel
 
static bool ApplyUpgradesEditorAuto = true
 
static boolPMBoolDelegate FindUpgradesDel
 
static voidPMNodeDelegate LoadExpansionNodes
 Hook for loading extra nodes common to all part modules. More...
 
static voidPMNodeDelegate LoadUpgradesDel
 
static voidPMNodeDelegate SaveExpansionNodes
 Hook for saving extra nodes common to all part modules. More...
 
static voidPMDelegate SetupExpansion
 Hook for performing extra setup common to all part modules. More...
 
static string UpgradesAvailableString = "#autoLOC_6002273"
 
static string UpgradesLockedString = "#autoLOC_6002274"
 
- Static Protected Attributes inherited from PartModule
static Dictionary< string,
ConfigNode
exclusives = new Dictionary<string, ConfigNode>()
 
static Dictionary< Type,
ReflectedAttributes
reflectedAttributeCache = new Dictionary<Type, ReflectedAttributes>()
 
- Properties inherited from PartModule
BaseActionList Actions [get]
 
int ClassID [get]
 
string ClassName [get]
 
List< AdjusterPartModuleBaseCurrentModuleAdjusterList [get]
 List of all the module adjusters that are currently active on this part module. More...
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 
string GUIName [get]
 
bool HasAdjusters [get]
 Has this part module been adjusted? More...
 
ReflectedAttributes ModuleAttributes [get, set]
 
Part part [get, set]
 
uint PersistentActionsId [get, set]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
uint PersistentId [get]
 A unique identifier for each vessel including from when it was Shipconstruct More...
 
Vessel vessel [get]
 

Member Function Documentation

Vector3 ModuleRCS.ApplyInputLinearAdjustments ( Vector3  inputLinear)
inlineprotected
Vector3 ModuleRCS.ApplyInputRotationAdjustments ( Vector3  inputRotation)
inlineprotected
float ModuleRCS.CalculateThrust ( float  totalForce,
out bool  success 
)
inline

< in tonnes/sec

< Request a mass of propellant and see what percentage of that was returned

< Multipy the thrust by the normalized amount of propellant we recieved

virtual bool ModuleRCS.CanBeDetached ( )
inlinevirtual

Returns true if not active.

Returns

Implements IConstruction.

virtual bool ModuleRCS.CanBeOffset ( )
inlinevirtual

Returns true if not active.

Returns

Implements IConstruction.

virtual bool ModuleRCS.CanBeRotated ( )
inlinevirtual

Returns true if not active.

Returns

Implements IConstruction.

virtual void ModuleRCS.DeactivateFX ( )
inlinevirtual

Reimplemented in ModuleRCSFX.

virtual void ModuleRCS.DeactivatePowerFX ( )
inlinevirtual

Reimplemented in ModuleRCSFX.

void ModuleRCS.FixedUpdate ( )
inline

< The projection is needed to be sure to only get the relevant displacement from CoM.

< clamp so you can't do >100% actuation.

List<PartResourceDefinition> ModuleRCS.GetConsumedResources ( )
inline

Implements IResourceConsumer.

override string ModuleRCS.GetInfo ( )
inlinevirtual

Returns formatted string of additional data for use in the VAB and SPH

Returns

Reimplemented from PartModule.

float ModuleRCS.GetLeverDistance ( Transform  trf,
Vector3  axis,
Vector3  leverPivotPosition 
)
inline

< Pythagorean identity, going from cos to sin. Remove the arcsin etc

float ModuleRCS.GetLeverDistanceOriginal ( Vector3  leverPivotPosition)
inline
override string ModuleRCS.GetModuleDisplayName ( )
inlinevirtual

Override this to provide a Localized version of the PartModules Name for UI components

Returns

Reimplemented from PartModule.

Reimplemented in ModuleRCSFX.

void ModuleRCS.GetPotentialTorque ( out Vector3  pos,
out Vector3  neg 
)
inline

Implements ITorqueProvider.

override string ModuleRCS.GetStagingDisableText ( )
inlinevirtual

Reimplemented from PartModule.

override string ModuleRCS.GetStagingEnableText ( )
inlinevirtual

Reimplemented from PartModule.

bool ModuleRCS.IsAdjusterBreakingRCS ( )
inlineprotected
override bool ModuleRCS.IsStageable ( )
inlinevirtual

Should this module be counted when seeing whether to have a stack icon present? Override in a module for custom behavior; otherwise returns true if the module (or something the module inherits from above PartModule itself) overrides OnActive()

Reimplemented from PartModule.

override void ModuleRCS.OnActive ( )
inlinevirtual

Called when the part is set active (after unpacking etc)

Reimplemented from PartModule.

override void ModuleRCS.OnAwake ( )
inlinevirtual

Method fires once the module has been added to the part. Use for first time setup. Module will not have loaded fully by this point

Reimplemented from PartModule.

Reimplemented in ModuleRCSFX.

override void ModuleRCS.OnLoad ( ConfigNode  node)
inlinevirtual

Use OnLoad to load any additional data from the ConfigNode provided

Parameters
node

Reimplemented from PartModule.

override void ModuleRCS.OnModuleAdjusterAdded ( AdjusterPartModuleBase  adjuster)
inlineprotectedvirtual

Perform processing specific to this part module when an adjuster is added.

Parameters
adjusterAdjuster which will be applied to part module.

Reimplemented from PartModule.

override void ModuleRCS.OnModuleAdjusterRemoved ( AdjusterPartModuleBase  adjuster)
inlinevirtual

Perform processing specific to this part module when an adjuster is removed.

Parameters
adjusterAdjuster which is being removed from part module.

Reimplemented from PartModule.

override void ModuleRCS.OnStart ( PartModule.StartState  state)
inline
double ModuleRCS.RequestPropellant ( double  mass)
inline

< How many units of propellant do we need to get our mass

< Get how much fuel we need for this request

< How much fuel did we get?

< Store propellant fractions recieved for final normalization of thrust

< From 0 to 1, how much of our request did we get.

void ModuleRCS.SetResource ( string  resource)
inline

< will load this resource using current flow mode.

virtual void ModuleRCS.SetupFX ( )
inlineprotectedvirtual

Reimplemented in ModuleRCSFX.

void ModuleRCS.SetupPropellant ( ConfigNode  node)
inline

< Debug.Log("Propellant ID: " + p.id);

void ModuleRCS.ToggleAction ( KSPActionParam  param)
inline
void ModuleRCS.ToggleToggles ( )
inline
void ModuleRCS.Update ( )
inline

< if (inputRot != Vector3.zero)

virtual void ModuleRCS.UpdatePowerFX ( bool  running,
int  idx,
float  power 
)
inlineprotectedvirtual

Reimplemented in ModuleRCSFX.

Member Data Documentation

FloatCurve ModuleRCS.atmosphereCurve

a curve to determine loss or gain of thrust due to changes in atmosphere vs vacuum values are based on ISP to ATM Pressure

bool ModuleRCS.currentShowToggles = false
bool ModuleRCS.enablePitch = true
bool ModuleRCS.enableRoll = true
bool ModuleRCS.enableX = true
bool ModuleRCS.enableY = true
bool ModuleRCS.enableYaw = true
bool ModuleRCS.enableZ = true
float ModuleRCS.EPSILON = 0.05f

Minimum latch for thrust. Is predominantly uses as Epsilon ^ 2 in comparisons

5% control actuation

bool ModuleRCS.flameout = false
double ModuleRCS.flowMult = 1d
bool ModuleRCS.fullThrust = false

always use full thrust

float ModuleRCS.fullThrustMin = 0.2f

if thrust amount from dots < this, don't do full thrust

Vector3 ModuleRCS.fxOffset = Vector3.zero
Vector3 ModuleRCS.fxOffsetRot = Vector3.zero
string ModuleRCS.fxPrefabName = "fx_gasJet_white"
string ModuleRCS.fxPrefix = "rcsGroup"
double ModuleRCS.G = 9.80665d
bool ModuleRCS.isJustForShow = false
double ModuleRCS.ispMult = 1d
double ModuleRCS.maxFuelFlow = 0d
double ModuleRCS.mixtureDensity

What is the density of the mixture.

double ModuleRCS.mixtureDensityRecip
float ModuleRCS.precisionFactor = 0.1f
Dictionary<Propellant, KSP.UI.Screens.ProtoStageIconInfo> ModuleRCS.PropellantGauges
protected
List<Propellant> ModuleRCS.propellants
bool ModuleRCS.rcs_active
bool ModuleRCS.rcsEnabled = true
float ModuleRCS.realISP = 0.0f
bool ModuleRCS.requiresFuel = true
string ModuleRCS.resourceFlowMode = "STAGE_PRIORITY_FLOW"
string ModuleRCS.resourceName = "MonoPropellant"
bool ModuleRCS.shieldedCanThrust = false
bool ModuleRCS.showToggles = true
int ModuleRCS.tC
protected
FloatCurve ModuleRCS.thrustCurve = new FloatCurve()

The curve to use

tracking fields for it (default non-displaying)

float ModuleRCS.thrustCurveDisplay = 1f
float ModuleRCS.thrustCurveRatio = 1f
List<FXGroup> ModuleRCS.thrusterFX
float ModuleRCS.thrusterPower = 1.0f
string ModuleRCS.thrusterTransformName = "RCSthruster"
List<Transform> ModuleRCS.thrusterTransforms
float [] ModuleRCS.thrustForces
float ModuleRCS.thrustPercentage = 100f
bool ModuleRCS.useLever = true
bool ModuleRCS.useThrottle = false
bool ModuleRCS.useThrustCurve = false

should we use a thrust curve (based on resource remaining) ?

bool ModuleRCS.useZaxis = false

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