Kerbal Space Program
1.12.4
|
Public Types | |
enum | ResourceConsumptionTypes { ResourceConsumptionTypes.VelocityLimit, ResourceConsumptionTypes.CurrentVelocity } |
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 } |
Public Member Functions | |||||||
Rigidbody | AttachServoRigidBody (AttachNode node) | ||||||
Returns the Rigidbody for the Servo Part that Joint Should connect to when this Part is the Parent for the Joint. More... | |||||||
GameObject | BaseObject () | ||||||
virtual bool | CanBeDetached () | ||||||
Returns true if not moving. More... | |||||||
virtual bool | CanBeOffset () | ||||||
Returns true if not moving. More... | |||||||
virtual bool | CanBeRotated () | ||||||
Returns true if not moving. More... | |||||||
override 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... | |||||||
void | DisengageMotor () | ||||||
Disengage the motor drive More... | |||||||
void | DisengageServoLock () | ||||||
Disengage the Lock on this robotic part More... | |||||||
void | EngageMotor () | ||||||
Engage the motor drive More... | |||||||
bool | EngageServoLock () | ||||||
Engage the Lock on this robotic part More... | |||||||
AxisFieldLimit | GetAxisFieldLimit (string fieldName) | ||||||
Get an AxisFieldLimit for a specific axisField More... | |||||||
List< AxisFieldLimit > | GetAxisFieldLimits () | ||||||
Get the list of AxisFieldLimit for AxisFields with hard/soft limits More... | |||||||
List< PartResourceDefinition > | GetConsumedResources () | ||||||
Vector2 | GetHardLimits (string fieldName) | ||||||
Get the HardLimits for the named field More... | |||||||
override string | GetInfo () | ||||||
Returns formatted string of additional data for use in the VAB and SPH More... | |||||||
Vector3 | GetMainAxis () | ||||||
float | GetModuleCost (float defaultCost, ModifierStagingSituation sit) | ||||||
Return the amount to modify the original part's dry cost by. Returned values are added to the base cost. (0 means no effect) More... | |||||||
ModifierChangeWhen | GetModuleCostChangeWhen () | ||||||
Return under which circumstances the modulecost changes More... | |||||||
float | GetModuleMass (float defaultMass, ModifierStagingSituation sit) | ||||||
Return the amount to modify the original part's dry mass by. Returned values are added to the base mass. (0 means no effect) More... | |||||||
ModifierChangeWhen | GetModuleMassChangeWhen () | ||||||
Return under which circumstances the modulemass changes More... | |||||||
Vector2 | GetSoftLimits (string fieldName) | ||||||
Get the SoftLimits for the named field More... | |||||||
bool | HasAxisFieldLimit (string fieldName) | ||||||
Does this partmodule have an AxisField of this name with hard/soft limits More... | |||||||
bool | HasAxisFieldLimits () | ||||||
Does this partmodule have any AxisFields with hard/soft limits More... | |||||||
bool | IsJointUnlocked () | ||||||
Return the part joint state More... | |||||||
GameObject | MovingObject () | ||||||
Rigidbody | NodeRigidBody (AttachNode node) | ||||||
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 | OnCopy (PartModule fromModule) | ||||||
Use OnCopy to copy any additional data from the PartModule provided More... | |||||||
override void | OnLoad (ConfigNode node) | ||||||
Use OnLoad to load any additional data from the ConfigNode provided More... | |||||||
abstract void | OnModifyServo () | ||||||
Updates the values of a PhysX servoJoint in Flight, including enabling/disabling the servoJoint. Is called when The KSPField values are modified for this PartModule. More... | |||||||
abstract void | OnPreModifyServo () | ||||||
Updates the values of a servo in both scenes. Is called when The PAW values are modified for this PartModule. More... | |||||||
override void | OnSave (ConfigNode node) | ||||||
Use OnSave to serialize additional module information into the ConfigNode provided More... | |||||||
override void | OnStart (PartModule.StartState state) | ||||||
override void | OnStartBeforePartAttachJoint (StartState modStartState) | ||||||
Called in flight scene in Part.Start just before the Part attachnode joints are created. More... | |||||||
override void | PromoteToPhysicalPart () | ||||||
This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part. More... | |||||||
bool | ServoTransformCollider (string colName) | ||||||
void | SetHardLimits (string fieldName, Vector2 newLimits) | ||||||
Set the HardLimits for the named field More... | |||||||
virtual void | SetLaunchPosition (float val) | ||||||
Save the launch position. More... | |||||||
void | SetSoftLimits (string fieldName, Vector2 newLimits) | ||||||
set the HardLimits for the named field More... | |||||||
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 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... | |||||||
virtual string | GetModuleDisplayName () | ||||||
Override this to provide a Localized version of the PartModules Name for UI components 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 | GetStagingDisableText () | ||||||
virtual string | GetStagingEnableText () | ||||||
virtual string | GetUpgradeInfo () | ||||||
Called by Upgrade Stats dialog More... | |||||||
bool | HasUpgrades () | ||||||
Returns true if upgrades exist for the partmodule More... | |||||||
virtual 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... | |||||||
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 | OnActive () | ||||||
Called when the part is set active (after unpacking etc) 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 | 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 | OnModuleAdjusterRemoved (AdjusterPartModuleBase adjuster) | ||||||
Perform processing specific to this part module when an adjuster is removed. By default this does nothing is up to each part module to implement it properly. 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 | 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 | 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.
| |||||||
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 () | ||||||
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) | ||||||
Static Public Member Functions | |
static void | CacheLocalStrings () |
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... | |
Public Attributes | |
float | baseResourceConsumptionRate = 0.001f |
Base resource consumption on motor output when the servo is moving More... | |
string | baseTransformName = "" |
The Part base Transform Name in the Model. This will be the Transform that is the base of the part (not the Servo). More... | |
float | connectedMassScale = 1f |
float | efficiency = 1 |
Servo efficiency (1 = 100%) More... | |
Vector2 | hardMinMaxLimits = new Vector2(0f, 180f) |
The angle range that's defined by the physical limits of the part model and/or the part's designer. A player must not be able to set an angle beyond this range. More... | |
bool | hideUIServoIsMotorized = false |
Hide the Servo Is motorized choice in Editor More... | |
bool | hideUIServoMotorLimit = false |
Hide the Servo motor limit slider in flight More... | |
bool | hideUIServoMotorSize = false |
Hide the Servo motor size slider in Editor More... | |
string | jointParentName = "JointParent" |
Name of the joint parent transform (parent of base and moving parts) More... | |
Quaternion | jointParentRotation |
float | launchPosition |
The default angle/extension last set on a robotic part has assigned, before launch. More... | |
bool | lockPartOnPowerLoss = true |
Is the servo motor receiving power and engaged with the joint More... | |
string | mainAxis = "Z" |
The main Axis of the Servo that rotations will be performed around. More... | |
float | maxMotorOutput = 100f |
This is the Drive Spring Multiplier. The Joint X Drive position spring is set to: driveSpringMultiplier * torqueLimit More... | |
float | motorizedCostPerDriveUnit = 1f |
How much the servo costs per drive unit. Drive units are equal to the value given to PhysX as Joint X Drive position spring. More... | |
float | motorizedMassPerKN = 0.1f |
How much the servo masses per KN. Drive units are equal to the value given to PhysX as Joint X Drive position spring. More... | |
string | motorOutputInformation = "" |
Display that shows how much output the motor has (based off of max motor output) and how much it weighs. More... | |
string | motorState = "" |
The Motor State More... | |
float | referenceConsumptionVelocity = 90f |
The transform velocity (angular or positional) at which the resource consumption is 1 x the baseResourceConsumptionRate More... | |
string | resourceConsumption = "0.0" |
Display that shows how much EC is being drained per tick. More... | |
ResourceConsumptionTypes | resourceConsumptionMode = ResourceConsumptionTypes.CurrentVelocity |
What should the resource consumption be based on More... | |
string | servoAttachNodes = "" |
A Comma separated list of AttachNodes that are part of the pivoting/rotating section of the servo. Any nodes listed will automatically be moved and rotated based on the movement of the servo. NOTE: This is only applied in the Editor scenes. More... | |
Vector3 | servoCoMOffset = Vector3.zero |
Offset of the servo (moving part's) CoM from its transform. More... | |
string | servoCurrentTorque |
The torque applied at the moment More... | |
bool | servoIsLocked = false |
Is the servo motor receiving power and engaged with the joint More... | |
bool | servoIsMotorized = true |
Is the servo receiving equipped with a motor More... | |
float | servoMass = 0.1f |
The Mass of the Servo. More... | |
bool | servoMotorIsEngaged = true |
Is the servo motor receiving power and engaged with the joint More... | |
float | servoMotorLimit = 100f |
Lowers the output of the servo to less than maximum built size in editor More... | |
float | servoMotorSize = 100f |
Lowers the size of the servo in editor scene as you build More... | |
string | servoName = "Servo_0" |
The Name of the Servo More... | |
string | servoSrfMeshNames = "" |
A comma separated list of Mesh/collider transform Names that are part of the pivoting/rotation section of the servo. Any parts that are surface attached to these colliders will be pivoted/rotated based on the movement of the ervo. More... | |
string | servoTransformName = "" |
The Servo Transform Name in the Model. This will be the Transform the Servo will be attached to. More... | |
Vector3 | servoTransformPosition |
Persists the servo Transform LocalPosition More... | |
Quaternion | servoTransformRotation |
Persists the servo Transform LocalRotation More... | |
Vector2 | traverseVelocityLimits = new Vector2(0.1f, 10f) |
The minimum and maximum traverse speeds (in m/s for linear motion and deg/s for rotational motion, rpm for rotors) More... | |
bool | useLimits = false |
Set to true to use Hard Limits on the angles. More... | |
bool | useMultipleDragCubes |
Set True to use multiple Drag Cubes. More... | |
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< ConfigNode > | upgrades |
List< string > | upgradesApplied = new List<string>() |
bool | upgradesApply = true |
bool | upgradesAsk = true |
Protected Member Functions | |
virtual void | ApplyCoordsUpdate () |
Applies Part Coordinate Updates. Can be overridden to apply appropriate changes to Part positions/rotations and components (servo transforms within a Part). Will be called when a Part is Unpacked, Vessel is Modified, and just before a ShipConstruct is saved. More... | |
void | CalculateAverageRateOfMovement () |
Uses the readings from GetFrameDisplacement to determine the average rate of change in the part's transform More... | |
virtual double | CalculatePower () |
Calculates the current power consumption in kW More... | |
virtual void | CalculateResourceDrain () |
Calculates the current resource drain rate and determines if there's still enough More... | |
void | CreateServoRigidbody () |
If the movingPartObject is set will set movingPartRB or add a RigidBody to the movingPartObject and set it's parameters and mass. More... | |
float | currentTransformAngle () |
float | currentTransformPosition () |
void | FixedUpdate () |
Handles resource requests More... | |
abstract float | GetFrameDisplacement () |
abstract void | InitAxisFieldLimits () |
void | InitJoint () |
Initializes the Servo Joint. Assumes the servoJoint is the Part.attachJoint.Joint. This can be overridden/changed in OnJointInit for specific servo being implemented using this class, which is called at the end of this method. In OnJointInit you will need to set servoJoint, axis, secAxis, initialOrentation, lastOrientation and pivot. PostStartInitJoint() and OnPostStartJointInit() are called AFTER the Part has created it's Part.attachJoint. More... | |
abstract bool | IsMoving () |
Is the servo currently moving/traversing? More... | |
void | ManuallyModifyEngaged (object field) |
void | ModifyEngaged (object field) |
void | ModifyLocked (object field) |
void | ModifyServo (object field) |
Call this to Update the Servo rotation. Will Call VisualizeServo or OnUpdateServo. More... | |
void | MotorOffAction (KSPActionParam param) |
void | MotorOnAction (KSPActionParam param) |
virtual void | OnDestroy () |
void | OnEditorCompoundPartLinked (CompoundPart linkedPart) |
void | OnEditorPartPicked (Part pickedPart) |
void | OnEditorPartPlaced (Part placedPart) |
abstract new void | OnFixedUpdate () |
Called every physics/fixed frame that the part is active More... | |
abstract void | OnJointInit (bool goodSetup) |
Called after BaseServo Joint Initialized and before Part attachJoint has been created. More... | |
void | OnPartMenuClose (Part inpPart) |
void | OnPartMenuOpen (UIPartActionWindow window, Part inpPart) |
abstract void | OnPostStartJointInit () |
Called after OnJointInit and the Part attachJoint has been created. More... | |
virtual void | OnSaveShip (ShipConstruct ship) |
When Ship is saved - we must apply orgPos and orgRot changes to the parts. More... | |
abstract void | OnServoLockApplied () |
Called when the servo lock is about to be applied More... | |
abstract void | OnServoLockRemoved () |
Called when the servo lock is about to be removed More... | |
abstract void | OnServoMotorDisengaged () |
Called when the servo lock is about to be removed More... | |
abstract void | OnServoMotorEngaged () |
Called when the servo lock is about to be applied More... | |
abstract void | OnVisualizeServo (bool rotateBase) |
Updates the transform of a robotic part in the editor scenes, so users can visualize rotations. Is called when The KSPField values are modified for this PartModule. More... | |
void | PostStartInitJoint () |
Completes the Initialize of the Servo Joint. sets the pJoint (part.attachJoint reference) and assigns it to the servoJoint ONLY if it hasn't already been assigned in InitJoint/OnJointInit. Connects the rigidbod to the joint and moves/rotates the moving part to ensure we dont hit Unity Angular Joint Limit Madness Will then call OnPostStartJointInit() In OnPostStartJointInit you will need to set any target values to their initial start ones and call ModifyServo amd set any init complete flags. More... | |
virtual void | RecurseAttachNodeUpdate (Part p) |
Will start at the passed in Part and then recurse (through all children) looking for BaseServo Parts. For each BaseServo Part found will update the attach Nodes (on the moving servo transform) position and orientation. Will do nothing is ServoInitComplete is false. More... | |
virtual void | RecurseCoordUpdate (Part p, Part rootPart) |
Sets Part orgPos and orgRot. Is called at the end of ApplyCoordsUpdate(). More... | |
abstract void | ResetLaunchPosition () |
Resets the launch position of the part. Needs to be overriden by part to acomodate it's parameters. More... | |
void | ResetPosition (KSPActionParam param) |
void | ResetPosition () |
void | RestoreSpanningPartTargets () |
void | SaveSpanningPartTargets () |
void | ServoDisgageLockAction (KSPActionParam param) |
void | ServoEngageLockAction (KSPActionParam param) |
abstract void | SetInitialDisplacement () |
void | SetServoMass () |
void | ToggleMotorAction (KSPActionParam param) |
void | ToggleServoLockedAction (KSPActionParam param) |
virtual void | Update () |
abstract void | UpdateAxisFieldHardLimit (string fieldName, Vector2 newlimits) |
void | UpdateAxisFieldLimit (string fieldName, Vector2 hardLimits, Vector2 softLimits) |
abstract void | UpdateAxisFieldSoftLimit (string fieldName, Vector2 newlimits) |
float | UpdateFieldLimits (BaseAxisField axisField, Vector2 newlimits, float currentValue, UI_FloatRange uiField=null) |
Change a fields limits and update the associated bits More... | |
virtual void | UpdatePAWUI (UI_Scene currentScene) |
void | VisualizeServo (bool moveChildren) |
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 | OnModuleAdjusterAdded (AdjusterPartModuleBase adjuster) |
Perform processing specific to this part module when an adjuster is added. By default this does nothing is up to each part module to implement it properly. More... | |
virtual void | SaveUpgradesApplied (ConfigNode node) |
Save the applied upgrades. More... | |
IEnumerator | UpgradeWaitForScenarioModules () |
Protected Attributes | |
List< AttachNode > | attachNodes |
Vector3 | axis |
DictionaryValueList< string, AxisFieldLimit > | axisFieldLimits |
GameObject | basePartObject |
Quaternion | cachedStartingRotation |
float | cachedStartingRotationOffset |
float | driveUnit |
The size of the drive = maxMotorSize * servoMotorSize * 0.01f More... | |
bool | hasEnoughResources |
Transform | jointParent |
The joint parent transform (parent of base and moving parts) More... | |
float | lockAngle |
bool | motorManualDisengaged = false |
float | motorOutput |
The actual motorOutupt = driveUnit * servoMotorLimit * 0.01f More... | |
GameObject | movingPartObject |
Rigidbody | movingPartRB |
string | OutputUnit |
bool | partIsPhysicsLess = false |
Will be set to true when the part is made physicsless and skips Update and FixedUpdate processing. This happens when the part is being manipulated in EVA construction mode. More... | |
Vector3 | pivot |
bool | prevServoIsLocked |
bool | prevServoIsMotorized |
bool | prevServoMotorIsEngaged |
double | rate = 0d |
bool | servoIsBraking = false |
ConfigurableJoint | servoJoint |
This is the Joint for this Servo on the Part. More... | |
UI_FloatRange | servoMotorLimitField |
UI_FloatRange | servoMotorSizeField |
Matrix4x4 | servoParentTransform |
This is the transform from the servo part FoR (ie, the moving part's parent's FoR) to the part FoR More... | |
Matrix4x4 | servoParentTransformInverse |
This is the transform from the part FoR to the servo part FoR (ie, the moving part's parent's FoR) (or, the inverse of servoParentTransform) More... | |
string[] | servoSrfMeshes |
Quaternion | targetRotation |
Properties | |
float | CurrentVelocityLimit [get] |
The current veloctiy limit of the joint. More... | |
bool | HasEnoughResources [get] |
Are there enough resources to keep the servo going? More... | |
Callback< AxisFieldLimit > | LimitsChanged [get, set] |
PartJoint | pJoint [get, set] |
This is the Part Joint (Part.attachJoint) More... | |
bool | ServoInitComplete [get] |
Set to true once the Servo has completed Initialization at start. More... | |
Properties inherited from PartModule | |
BaseActionList | Actions [get] |
int | ClassID [get] |
string | ClassName [get] |
List< AdjusterPartModuleBase > | CurrentModuleAdjusterList [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] |
Properties inherited from IAxisFieldLimits | |
Callback< AxisFieldLimit > | LimitsChanged [get, set] |
Callback function that should be triggered when an AxisField Limit changes More... | |
Additional Inherited Members | |
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>() |
|
inlineprotectedvirtual |
|
inline |
|
inline |
|
inlinestatic |
|
inlineprotected |
Uses the readings from GetFrameDisplacement to determine the average rate of change in the part's transform
|
inlineprotectedvirtual |
Calculates the current power consumption in kW
|
inlineprotectedvirtual |
Calculates the current resource drain rate and determines if there's still enough
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlineprotected |
If the movingPartObject is set will set movingPartRB or add a RigidBody to the movingPartObject and set it's parameters and mass.
|
inlineprotected |
|
inlineprotected |
|
inlinevirtual |
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.
Reimplemented from PartModule.
|
inline |
Disengage the motor drive
|
inline |
Disengage the Lock on this robotic part
|
inline |
Engage the motor drive
|
inline |
Engage the Lock on this robotic part
|
inlineprotected |
Handles resource requests
|
inline |
Get an AxisFieldLimit for a specific axisField
Implements IAxisFieldLimits.
|
inline |
Get the list of AxisFieldLimit for AxisFields with hard/soft limits
Implements IAxisFieldLimits.
|
inline |
Implements IResourceConsumer.
|
protectedpure virtual |
|
inline |
Get the HardLimits for the named field
Implements IAxisFieldLimits.
|
inlinevirtual |
Returns formatted string of additional data for use in the VAB and SPH
Reimplemented from PartModule.
Reimplemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
inline |
|
inline |
Return the amount to modify the original part's dry cost by. Returned values are added to the base cost. (0 means no effect)
Implements IPartCostModifier.
|
inline |
|
inline |
Return the amount to modify the original part's dry mass by. Returned values are added to the base mass. (0 means no effect)
Implements IPartMassModifier.
|
inline |
|
inline |
Get the SoftLimits for the named field
Implements IAxisFieldLimits.
|
inline |
Does this partmodule have an AxisField of this name with hard/soft limits
Implements IAxisFieldLimits.
|
inline |
Does this partmodule have any AxisFields with hard/soft limits
Implements IAxisFieldLimits.
|
protectedpure virtual |
|
inlineprotected |
Initializes the Servo Joint. Assumes the servoJoint is the Part.attachJoint.Joint. This can be overridden/changed in OnJointInit for specific servo being implemented using this class, which is called at the end of this method. In OnJointInit you will need to set servoJoint, axis, secAxis, initialOrentation, lastOrientation and pivot. PostStartInitJoint() and OnPostStartJointInit() are called AFTER the Part has created it's Part.attachJoint.
|
inline |
|
protectedpure virtual |
Is the servo currently moving/traversing?
Implemented in Expansions.Serenity.ModuleRoboticServoRotor, Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, and Expansions.Serenity.ModuleRoboticServoPiston.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Call this to Update the Servo rotation. Will Call VisualizeServo or OnUpdateServo.
field |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
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.
|
inlinevirtual |
Use OnCopy to copy any additional data from the PartModule provided
fromModule |
Reimplemented from PartModule.
Reimplemented in Expansions.Serenity.ModuleRoboticServoHinge, and Expansions.Serenity.ModuleRoboticRotationServo.
|
inlineprotectedvirtual |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
protectedpure virtual |
Called every physics/fixed frame that the part is active
Reimplemented from PartModule.
Implemented in Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
protectedpure virtual |
Called after BaseServo Joint Initialized and before Part attachJoint has been created.
goodSetup |
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
inlinevirtual |
Use OnLoad to load any additional data from the ConfigNode provided
node |
Reimplemented from PartModule.
|
pure virtual |
Updates the values of a PhysX servoJoint in Flight, including enabling/disabling the servoJoint. Is called when The KSPField values are modified for this PartModule.
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoPiston, and Expansions.Serenity.ModuleRoboticServoRotor.
|
inlineprotected |
|
inlineprotected |
|
protectedpure virtual |
Called after OnJointInit and the Part attachJoint has been created.
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
pure virtual |
Updates the values of a servo in both scenes. Is called when The PAW values are modified for this PartModule.
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
inlinevirtual |
Use OnSave to serialize additional module information into the ConfigNode provided
node |
Reimplemented from PartModule.
|
inlineprotectedvirtual |
When Ship is saved - we must apply orgPos and orgRot changes to the parts.
ship |
Reimplemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
protectedpure virtual |
Called when the servo lock is about to be applied
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoPiston, and Expansions.Serenity.ModuleRoboticServoRotor.
|
protectedpure virtual |
Called when the servo lock is about to be removed
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoPiston, and Expansions.Serenity.ModuleRoboticServoRotor.
|
protectedpure virtual |
Called when the servo lock is about to be removed
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoPiston, and Expansions.Serenity.ModuleRoboticServoRotor.
|
protectedpure virtual |
Called when the servo lock is about to be applied
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoPiston, and Expansions.Serenity.ModuleRoboticServoRotor.
|
inline |
|
inlinevirtual |
Called in flight scene in Part.Start just before the Part attachnode joints are created.
state |
Reimplemented from PartModule.
|
protectedpure virtual |
Updates the transform of a robotic part in the editor scenes, so users can visualize rotations. Is called when The KSPField values are modified for this PartModule.
Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.
|
inlineprotected |
Completes the Initialize of the Servo Joint. sets the pJoint (part.attachJoint reference) and assigns it to the servoJoint ONLY if it hasn't already been assigned in InitJoint/OnJointInit. Connects the rigidbod to the joint and moves/rotates the moving part to ensure we dont hit Unity Angular Joint Limit Madness Will then call OnPostStartJointInit() In OnPostStartJointInit you will need to set any target values to their initial start ones and call ModifyServo amd set any init complete flags.
|
inlinevirtual |
This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part.
Reimplemented from PartModule.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Sets Part orgPos and orgRot. Is called at the end of ApplyCoordsUpdate().
p | The Part |
destPos | The Destination Position |
destRot | The Destination Rotation |
pivot | The pivot position |
|
protectedpure virtual |
Resets the launch position of the part. Needs to be overriden by part to acomodate it's parameters.
Implemented in Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, Expansions.Serenity.ModuleRoboticServoHinge, and Expansions.Serenity.ModuleRoboticServoPiston.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
Set the HardLimits for the named field
Implements IAxisFieldLimits.
|
protectedpure virtual |
|
inlinevirtual |
Save the launch position.
val | Target extension/angle to be saved as launchPosition. |
|
inlineprotected |
|
inline |
set the HardLimits for the named field
Implements IAxisFieldLimits.
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
|
protectedpure virtual |
|
inlineprotected |
|
protectedpure virtual |
|
inlineprotected |
Change a fields limits and update the associated bits
axisField | The field whose limits are being changed |
newlimits | The new limits |
currentValue | The current value |
uiField | The UI_FloatRange that relates to this field |
|
inlineprotectedvirtual |
|
inlineprotected |
|
protected |
|
protected |
|
protected |
|
protected |
float Expansions.Serenity.BaseServo.baseResourceConsumptionRate = 0.001f |
Base resource consumption on motor output when the servo is moving
string Expansions.Serenity.BaseServo.baseTransformName = "" |
The Part base Transform Name in the Model. This will be the Transform that is the base of the part (not the Servo).
|
protected |
|
protected |
float Expansions.Serenity.BaseServo.connectedMassScale = 1f |
|
protected |
The size of the drive = maxMotorSize * servoMotorSize * 0.01f
float Expansions.Serenity.BaseServo.efficiency = 1 |
Servo efficiency (1 = 100%)
Vector2 Expansions.Serenity.BaseServo.hardMinMaxLimits = new Vector2(0f, 180f) |
The angle range that's defined by the physical limits of the part model and/or the part's designer. A player must not be able to set an angle beyond this range.
|
protected |
bool Expansions.Serenity.BaseServo.hideUIServoIsMotorized = false |
Hide the Servo Is motorized choice in Editor
bool Expansions.Serenity.BaseServo.hideUIServoMotorLimit = false |
Hide the Servo motor limit slider in flight
bool Expansions.Serenity.BaseServo.hideUIServoMotorSize = false |
Hide the Servo motor size slider in Editor
|
protected |
The joint parent transform (parent of base and moving parts)
string Expansions.Serenity.BaseServo.jointParentName = "JointParent" |
Name of the joint parent transform (parent of base and moving parts)
Quaternion Expansions.Serenity.BaseServo.jointParentRotation |
float Expansions.Serenity.BaseServo.launchPosition |
The default angle/extension last set on a robotic part has assigned, before launch.
|
protected |
bool Expansions.Serenity.BaseServo.lockPartOnPowerLoss = true |
Is the servo motor receiving power and engaged with the joint
string Expansions.Serenity.BaseServo.mainAxis = "Z" |
The main Axis of the Servo that rotations will be performed around.
float Expansions.Serenity.BaseServo.maxMotorOutput = 100f |
This is the Drive Spring Multiplier. The Joint X Drive position spring is set to: driveSpringMultiplier * torqueLimit
float Expansions.Serenity.BaseServo.motorizedCostPerDriveUnit = 1f |
How much the servo costs per drive unit. Drive units are equal to the value given to PhysX as Joint X Drive position spring.
float Expansions.Serenity.BaseServo.motorizedMassPerKN = 0.1f |
How much the servo masses per KN. Drive units are equal to the value given to PhysX as Joint X Drive position spring.
|
protected |
|
protected |
The actual motorOutupt = driveUnit * servoMotorLimit * 0.01f
string Expansions.Serenity.BaseServo.motorOutputInformation = "" |
Display that shows how much output the motor has (based off of max motor output) and how much it weighs.
string Expansions.Serenity.BaseServo.motorState = "" |
The Motor State
|
protected |
|
protected |
|
protected |
|
protected |
Will be set to true when the part is made physicsless and skips Update and FixedUpdate processing. This happens when the part is being manipulated in EVA construction mode.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
float Expansions.Serenity.BaseServo.referenceConsumptionVelocity = 90f |
The transform velocity (angular or positional) at which the resource consumption is 1 x the baseResourceConsumptionRate
string Expansions.Serenity.BaseServo.resourceConsumption = "0.0" |
Display that shows how much EC is being drained per tick.
ResourceConsumptionTypes Expansions.Serenity.BaseServo.resourceConsumptionMode = ResourceConsumptionTypes.CurrentVelocity |
What should the resource consumption be based on
string Expansions.Serenity.BaseServo.servoAttachNodes = "" |
A Comma separated list of AttachNodes that are part of the pivoting/rotating section of the servo. Any nodes listed will automatically be moved and rotated based on the movement of the servo. NOTE: This is only applied in the Editor scenes.
Vector3 Expansions.Serenity.BaseServo.servoCoMOffset = Vector3.zero |
Offset of the servo (moving part's) CoM from its transform.
string Expansions.Serenity.BaseServo.servoCurrentTorque |
The torque applied at the moment
|
protected |
bool Expansions.Serenity.BaseServo.servoIsLocked = false |
Is the servo motor receiving power and engaged with the joint
bool Expansions.Serenity.BaseServo.servoIsMotorized = true |
Is the servo receiving equipped with a motor
|
protected |
This is the Joint for this Servo on the Part.
float Expansions.Serenity.BaseServo.servoMass = 0.1f |
The Mass of the Servo.
bool Expansions.Serenity.BaseServo.servoMotorIsEngaged = true |
Is the servo motor receiving power and engaged with the joint
float Expansions.Serenity.BaseServo.servoMotorLimit = 100f |
Lowers the output of the servo to less than maximum built size in editor
|
protected |
float Expansions.Serenity.BaseServo.servoMotorSize = 100f |
Lowers the size of the servo in editor scene as you build
|
protected |
string Expansions.Serenity.BaseServo.servoName = "Servo_0" |
The Name of the Servo
|
protected |
This is the transform from the servo part FoR (ie, the moving part's parent's FoR) to the part FoR
|
protected |
This is the transform from the part FoR to the servo part FoR (ie, the moving part's parent's FoR) (or, the inverse of servoParentTransform)
|
protected |
string Expansions.Serenity.BaseServo.servoSrfMeshNames = "" |
A comma separated list of Mesh/collider transform Names that are part of the pivoting/rotation section of the servo. Any parts that are surface attached to these colliders will be pivoted/rotated based on the movement of the ervo.
string Expansions.Serenity.BaseServo.servoTransformName = "" |
The Servo Transform Name in the Model. This will be the Transform the Servo will be attached to.
Vector3 Expansions.Serenity.BaseServo.servoTransformPosition |
Persists the servo Transform LocalPosition
Quaternion Expansions.Serenity.BaseServo.servoTransformRotation |
Persists the servo Transform LocalRotation
|
protected |
Vector2 Expansions.Serenity.BaseServo.traverseVelocityLimits = new Vector2(0.1f, 10f) |
The minimum and maximum traverse speeds (in m/s for linear motion and deg/s for rotational motion, rpm for rotors)
bool Expansions.Serenity.BaseServo.useLimits = false |
Set to true to use Hard Limits on the angles.
bool Expansions.Serenity.BaseServo.useMultipleDragCubes |
Set True to use multiple Drag Cubes.
|
get |
The current veloctiy limit of the joint.
|
get |
Are there enough resources to keep the servo going?
|
getset |
|
getset |
This is the Part Joint (Part.attachJoint)
|
get |
Set to true once the Servo has completed Initialization at start.