Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
Expansions.Serenity.ModuleRoboticServoPiston Class Reference
Inheritance diagram for Expansions.Serenity.ModuleRoboticServoPiston:
Expansions.Serenity.BaseServo IMultipleDragCube PartModule IResourceConsumer IPartCostModifier IPartMassModifier IAxisFieldLimits IJointLockState IConstruction

Public Member Functions

void AssumeDragCubePosition (string name)
 Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. When called the module should set it's model position/setup to match the expected position/orientation when 'name' drag cube is active. More...
 
void ExtendPiston ()
 Change the target to the max value More...
 
string[] GetDragCubeNames ()
 Should return an array of strings that are the drag cube names that this module implements. More...
 
override string GetInfo ()
 Returns formatted string of additional data for use in the VAB and SPH More...
 
override string GetModuleDisplayName ()
 Returns the display name for the module. More...
 
override 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...
 
override 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 OnStart (PartModule.StartState state)
 
void RetractPiston ()
 Change the target to the min value More...
 
void TogglePistonAction (KSPActionParam param)
 
bool UsesProceduralDragCubes ()
 Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. Should return true if this module is to use procedural drag cubes and false if it is to generate drag cubes for the drag cube names returned in GetDragCubeNames method. More...
 
- Public Member Functions inherited from Expansions.Serenity.BaseServo
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< AxisFieldLimitGetAxisFieldLimits ()
 Get the list of AxisFieldLimit for AxisFields with hard/soft limits More...
 
List< PartResourceDefinitionGetConsumedResources ()
 
Vector2 GetHardLimits (string fieldName)
 Get the HardLimits for the named field 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...
 
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...
 
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.

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 ()
 
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 new void CacheLocalStrings ()
 
- Static Public Member Functions inherited from Expansions.Serenity.BaseServo
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 currentExtension
 
float driveTargetPosition
 This is the robotic drive Target Position. More...
 
bool hideUIDamping = false
 Hide the Damping Slider in the PAW More...
 
bool hideUISoftMinMaxExtension = false
 Hide the Min/Max extension UI component in Editor More...
 
bool hideUITraverseVelocity = false
 Hide the TraverseVelocity Slider in the PAW More...
 
float linearLimitBounce = 0.2f
 
float linearLimitContactDistance = 1
 
float linearLimitSpringDamper = 100000
 
float linearLimitSpringSpring = 100000
 
float pistonDamping = 100f
 
float positionDampingMutliplier = 0.1f
 This is the Drive Dampening Multiplier. The Joint position damper is set to: xxxxx More...
 
float positionSpringMutliplier = 100f
 This is the Drive Spring Multiplier. The Joint position spring is set to: xxxxxx More...
 
float powerLossExtension = 0f
 
string slaveTransformNames = ""
 Comma separated list of names of transforms used for slave segments that interpolate their positions between servoTransform and baseTransform. The first transform in the list will be closest to servoTransform and the last closest to baseTransform, with any in between interpoleted in listed order. More...
 
Vector2 softMinMaxExtension = new Vector2(0f, 100f)
 Soft (editor) limits of motion for the piston (in m). /summary> More...
 
float targetExtension = 0f
 
float traverseVelocity = 1f
 The velocity at which the servo will move to the target position. Expressed in m/s. More...
 
- Public Attributes inherited from Expansions.Serenity.BaseServo
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< ConfigNodeupgrades
 
List< string > upgradesApplied = new List<string>()
 
bool upgradesApply = true
 
bool upgradesAsk = true
 

Protected Member Functions

Vector3 CalcTargetPosition (Vector3 startingPosition, float offset, bool relative)
 
void ExtendPistonAction (KSPActionParam param)
 
override float GetFrameDisplacement ()
 Checks how much the rod of the piston moved during one frame More...
 
override void InitAxisFieldLimits ()
 
override bool IsMoving ()
 Is the servo currently moving/traversing? More...
 
void LateUpdate ()
 
void ModifyLimits (object field)
 
override void OnDestroy ()
 
override void OnFixedUpdate ()
 Called every physics/fixed frame that the part is active More...
 
override void OnJointInit (bool goodSetup)
 Called after BaseServo Joint Initialized and before Part attachJoint has been created. More...
 
override void OnPostStartJointInit ()
 Called after OnJointInit and the Part attachJoint has been created. More...
 
void OnResourceNonemptyEmpty (PartResource resource)
 Hook for when EC runs out More...
 
override void OnSaveShip (ShipConstruct ship)
 When Ship is saved - we must apply orgPos and orgRot changes to the parts. More...
 
override void OnServoLockApplied ()
 Called when the servo lock is about to be applied More...
 
override void OnServoLockRemoved ()
 Called when the servo lock is about to be removed More...
 
override void OnServoMotorDisengaged ()
 Called when the servo lock is about to be removed More...
 
override void OnServoMotorEngaged ()
 Called when the servo lock is about to be applied More...
 
override void OnVisualizeServo (bool moveBase)
 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...
 
override void ResetLaunchPosition ()
 Resets the launch position of the part. Needs to be overriden by part to acomodate it's parameters. More...
 
void RetractPistonAction (KSPActionParam param)
 
override void SetInitialDisplacement ()
 Sets the initial transform angle for previousDisplacement More...
 
override void UpdateAxisFieldHardLimit (string fieldName, Vector2 newlimits)
 
override void UpdateAxisFieldSoftLimit (string fieldName, Vector2 newlimits)
 
override void UpdatePAWUI (UI_Scene currentScene)
 
void UpdateTargetPosition (object field)
 
void UpdateTraverseVelocity (object field)
 
- Protected Member Functions inherited from Expansions.Serenity.BaseServo
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...
 
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...
 
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)
 
void OnEditorCompoundPartLinked (CompoundPart linkedPart)
 
void OnEditorPartPicked (Part pickedPart)
 
void OnEditorPartPlaced (Part placedPart)
 
void OnPartMenuClose (Part inpPart)
 
void OnPartMenuOpen (UIPartActionWindow window, Part inpPart)
 
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...
 
void ResetPosition (KSPActionParam param)
 
void ResetPosition ()
 
void RestoreSpanningPartTargets ()
 
void SaveSpanningPartTargets ()
 
void ServoDisgageLockAction (KSPActionParam param)
 
void ServoEngageLockAction (KSPActionParam param)
 
void SetServoMass ()
 
void ToggleMotorAction (KSPActionParam param)
 
void ToggleServoLockedAction (KSPActionParam param)
 
virtual void Update ()
 
void UpdateAxisFieldLimit (string fieldName, Vector2 hardLimits, Vector2 softLimits)
 
float UpdateFieldLimits (BaseAxisField axisField, Vector2 newlimits, float currentValue, UI_FloatRange uiField=null)
 Change a fields limits and update the associated bits More...
 
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

Vector3 editorPostion
 
bool initComplete = false
 
JointDrive jointDrive
 
SoftJointLimit linearLimit
 
SoftJointLimitSpring linearLimitSpring
 
float previousTargetPosition
 
Transform[] slaveTransforms = null
 
UI_MinMaxRange softRangeField
 
BaseAxisField targetExtensionAxisField
 
UI_FloatRange targetExtensionField
 
- Protected Attributes inherited from Expansions.Serenity.BaseServo
List< AttachNodeattachNodes
 
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

bool IsMultipleCubesActive [get]
 
- Properties inherited from Expansions.Serenity.BaseServo
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< AxisFieldLimitLimitsChanged [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< 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]
 
- Properties inherited from IAxisFieldLimits
Callback< AxisFieldLimitLimitsChanged [get, set]
 Callback function that should be triggered when an AxisField Limit changes More...
 
- Properties inherited from IMultipleDragCube
bool IsMultipleCubesActive [get]
 Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. Should return true if multiple drag cubes are expected to be generated for the part this module is a part of or false if not. More...
 

Additional Inherited Members

- Public Types inherited from Expansions.Serenity.BaseServo
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
}
 
- 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>()
 

Member Function Documentation

void Expansions.Serenity.ModuleRoboticServoPiston.AssumeDragCubePosition ( string  name)
inline

Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. When called the module should set it's model position/setup to match the expected position/orientation when 'name' drag cube is active.

Parameters
nameThe name of the drag cube to assume the position/setup for.

Implements IMultipleDragCube.

static new void Expansions.Serenity.ModuleRoboticServoPiston.CacheLocalStrings ( )
inlinestatic
Vector3 Expansions.Serenity.ModuleRoboticServoPiston.CalcTargetPosition ( Vector3  startingPosition,
float  offset,
bool  relative 
)
inlineprotected
void Expansions.Serenity.ModuleRoboticServoPiston.ExtendPiston ( )
inline

Change the target to the max value

void Expansions.Serenity.ModuleRoboticServoPiston.ExtendPistonAction ( KSPActionParam  param)
inlineprotected
string [] Expansions.Serenity.ModuleRoboticServoPiston.GetDragCubeNames ( )
inline

Should return an array of strings that are the drag cube names that this module implements.

Returns

Implements IMultipleDragCube.

override float Expansions.Serenity.ModuleRoboticServoPiston.GetFrameDisplacement ( )
inlineprotectedvirtual

Checks how much the rod of the piston moved during one frame

Returns
the position difference among previous and current frame, in meters

Implements Expansions.Serenity.BaseServo.

override string Expansions.Serenity.ModuleRoboticServoPiston.GetInfo ( )
inlinevirtual

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

Returns

Reimplemented from Expansions.Serenity.BaseServo.

override string Expansions.Serenity.ModuleRoboticServoPiston.GetModuleDisplayName ( )
inlinevirtual

Returns the display name for the module.

Returns
The display name for the module.

Reimplemented from PartModule.

override void Expansions.Serenity.ModuleRoboticServoPiston.InitAxisFieldLimits ( )
inlineprotectedvirtual
override bool Expansions.Serenity.ModuleRoboticServoPiston.IsMoving ( )
inlineprotectedvirtual

Is the servo currently moving/traversing?

Returns

Implements Expansions.Serenity.BaseServo.

void Expansions.Serenity.ModuleRoboticServoPiston.LateUpdate ( )
inlineprotected
void Expansions.Serenity.ModuleRoboticServoPiston.ModifyLimits ( object  field)
inlineprotected
override void Expansions.Serenity.ModuleRoboticServoPiston.OnDestroy ( )
inlineprotectedvirtual

Reimplemented from Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnFixedUpdate ( )
inlineprotectedvirtual

Called every physics/fixed frame that the part is active

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnJointInit ( bool  goodSetup)
inlineprotectedvirtual

Called after BaseServo Joint Initialized and before Part attachJoint has been created.

Parameters
goodSetup

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnModifyServo ( )
inlinevirtual

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.

Returns

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnPostStartJointInit ( )
inlineprotectedvirtual

Called after OnJointInit and the Part attachJoint has been created.

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnPreModifyServo ( )
inlinevirtual

Updates the values of a servo in both scenes. Is called when The PAW values are modified for this PartModule.

Returns

Implements Expansions.Serenity.BaseServo.

void Expansions.Serenity.ModuleRoboticServoPiston.OnResourceNonemptyEmpty ( PartResource  resource)
inlineprotected

Hook for when EC runs out

override void Expansions.Serenity.ModuleRoboticServoPiston.OnSaveShip ( ShipConstruct  ship)
inlineprotectedvirtual

When Ship is saved - we must apply orgPos and orgRot changes to the parts.

Parameters
ship

Reimplemented from Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnServoLockApplied ( )
inlineprotectedvirtual

Called when the servo lock is about to be applied

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnServoLockRemoved ( )
inlineprotectedvirtual

Called when the servo lock is about to be removed

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnServoMotorDisengaged ( )
inlineprotectedvirtual

Called when the servo lock is about to be removed

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnServoMotorEngaged ( )
inlineprotectedvirtual

Called when the servo lock is about to be applied

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.OnStart ( PartModule.StartState  state)
inline
override void Expansions.Serenity.ModuleRoboticServoPiston.OnVisualizeServo ( bool  rotateBase)
inlineprotectedvirtual

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.

Returns

Implements Expansions.Serenity.BaseServo.

override void Expansions.Serenity.ModuleRoboticServoPiston.ResetLaunchPosition ( )
inlineprotectedvirtual

Resets the launch position of the part. Needs to be overriden by part to acomodate it's parameters.

Implements Expansions.Serenity.BaseServo.

void Expansions.Serenity.ModuleRoboticServoPiston.RetractPiston ( )
inline

Change the target to the min value

void Expansions.Serenity.ModuleRoboticServoPiston.RetractPistonAction ( KSPActionParam  param)
inlineprotected
override void Expansions.Serenity.ModuleRoboticServoPiston.SetInitialDisplacement ( )
inlineprotectedvirtual

Sets the initial transform angle for previousDisplacement

Implements Expansions.Serenity.BaseServo.

void Expansions.Serenity.ModuleRoboticServoPiston.TogglePistonAction ( KSPActionParam  param)
inline
override void Expansions.Serenity.ModuleRoboticServoPiston.UpdateAxisFieldHardLimit ( string  fieldName,
Vector2  newlimits 
)
inlineprotectedvirtual
override void Expansions.Serenity.ModuleRoboticServoPiston.UpdateAxisFieldSoftLimit ( string  fieldName,
Vector2  newlimits 
)
inlineprotectedvirtual
override void Expansions.Serenity.ModuleRoboticServoPiston.UpdatePAWUI ( UI_Scene  currentScene)
inlineprotectedvirtual

Reimplemented from Expansions.Serenity.BaseServo.

void Expansions.Serenity.ModuleRoboticServoPiston.UpdateTargetPosition ( object  field)
inlineprotected
void Expansions.Serenity.ModuleRoboticServoPiston.UpdateTraverseVelocity ( object  field)
inlineprotected
bool Expansions.Serenity.ModuleRoboticServoPiston.UsesProceduralDragCubes ( )
inline

Used by the DragCubeSystem when it is generating drag cube entries on startup if none are found for this module. Should return true if this module is to use procedural drag cubes and false if it is to generate drag cubes for the drag cube names returned in GetDragCubeNames method.

Returns

Implements IMultipleDragCube.

Member Data Documentation

float Expansions.Serenity.ModuleRoboticServoPiston.currentExtension
float Expansions.Serenity.ModuleRoboticServoPiston.driveTargetPosition

This is the robotic drive Target Position.

Vector3 Expansions.Serenity.ModuleRoboticServoPiston.editorPostion
protected
bool Expansions.Serenity.ModuleRoboticServoPiston.hideUIDamping = false

Hide the Damping Slider in the PAW

summary> Elasticity coefficient for when the piston collides with the ends (when linearLimitSpringSpring is 0) (0..1 for realism, > 1 for magic). /summary>

bool Expansions.Serenity.ModuleRoboticServoPiston.hideUISoftMinMaxExtension = false

Hide the Min/Max extension UI component in Editor

summary> Target position of the moving portion relative to the joint parent transform (in m) along the designated axis. /summary>

bool Expansions.Serenity.ModuleRoboticServoPiston.hideUITraverseVelocity = false

Hide the TraverseVelocity Slider in the PAW

summary> This is a multiplier for the driver damping force. /summary>

bool Expansions.Serenity.ModuleRoboticServoPiston.initComplete = false
protected
JointDrive Expansions.Serenity.ModuleRoboticServoPiston.jointDrive
protected
SoftJointLimit Expansions.Serenity.ModuleRoboticServoPiston.linearLimit
protected
float Expansions.Serenity.ModuleRoboticServoPiston.linearLimitBounce = 0.2f

summary> Spring force for piston over-extensions in kN/m (0..inf). /summary>

float Expansions.Serenity.ModuleRoboticServoPiston.linearLimitContactDistance = 1
SoftJointLimitSpring Expansions.Serenity.ModuleRoboticServoPiston.linearLimitSpring
protected
float Expansions.Serenity.ModuleRoboticServoPiston.linearLimitSpringDamper = 100000

summary> Tuning distance (m) for when PhysX should start checking for limit conditions. 0 means PhysX won't check until the limits are exceded,

0 results in higher processing costs, but more accurate limit checks.

/summary>

float Expansions.Serenity.ModuleRoboticServoPiston.linearLimitSpringSpring = 100000

summary> Damping for piston over-extensions (when linearLimitSpringSpring is not 0) in kNs/m (0..inf). /summary>

float Expansions.Serenity.ModuleRoboticServoPiston.pistonDamping = 100f
float Expansions.Serenity.ModuleRoboticServoPiston.positionDampingMutliplier = 0.1f

This is the Drive Dampening Multiplier. The Joint position damper is set to: xxxxx

float Expansions.Serenity.ModuleRoboticServoPiston.positionSpringMutliplier = 100f

This is the Drive Spring Multiplier. The Joint position spring is set to: xxxxxx

float Expansions.Serenity.ModuleRoboticServoPiston.powerLossExtension = 0f
float Expansions.Serenity.ModuleRoboticServoPiston.previousTargetPosition
protected
string Expansions.Serenity.ModuleRoboticServoPiston.slaveTransformNames = ""

Comma separated list of names of transforms used for slave segments that interpolate their positions between servoTransform and baseTransform. The first transform in the list will be closest to servoTransform and the last closest to baseTransform, with any in between interpoleted in listed order.

Transform [] Expansions.Serenity.ModuleRoboticServoPiston.slaveTransforms = null
protected
Vector2 Expansions.Serenity.ModuleRoboticServoPiston.softMinMaxExtension = new Vector2(0f, 100f)

Soft (editor) limits of motion for the piston (in m). /summary>

UI_MinMaxRange Expansions.Serenity.ModuleRoboticServoPiston.softRangeField
protected
float Expansions.Serenity.ModuleRoboticServoPiston.targetExtension = 0f
BaseAxisField Expansions.Serenity.ModuleRoboticServoPiston.targetExtensionAxisField
protected

summary> Current position of the moving portion relative to the joint parent transform (in m) along the designated axis. /summary>

UI_FloatRange Expansions.Serenity.ModuleRoboticServoPiston.targetExtensionField
protected
float Expansions.Serenity.ModuleRoboticServoPiston.traverseVelocity = 1f

The velocity at which the servo will move to the target position. Expressed in m/s.

Property Documentation

bool Expansions.Serenity.ModuleRoboticServoPiston.IsMultipleCubesActive
get

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