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

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< 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...
 
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.

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 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< ConfigNodeupgrades
 
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< 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

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...
 

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>()
 

Member Enumeration Documentation

Enumerator
VelocityLimit 

Base the resource Consumption on the Traverse/RPMLimit

CurrentVelocity 

Base the resource consumption on the average velocity

Member Function Documentation

virtual void Expansions.Serenity.BaseServo.ApplyCoordsUpdate ( )
inlineprotectedvirtual

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.

Rigidbody Expansions.Serenity.BaseServo.AttachServoRigidBody ( AttachNode  node)
inline

Returns the Rigidbody for the Servo Part that Joint Should connect to when this Part is the Parent for the Joint.

Returns
GameObject Expansions.Serenity.BaseServo.BaseObject ( )
inline
static void Expansions.Serenity.BaseServo.CacheLocalStrings ( )
inlinestatic
void Expansions.Serenity.BaseServo.CalculateAverageRateOfMovement ( )
inlineprotected

Uses the readings from GetFrameDisplacement to determine the average rate of change in the part's transform

virtual double Expansions.Serenity.BaseServo.CalculatePower ( )
inlineprotectedvirtual

Calculates the current power consumption in kW

Returns
power consumption in kW
virtual void Expansions.Serenity.BaseServo.CalculateResourceDrain ( )
inlineprotectedvirtual

Calculates the current resource drain rate and determines if there's still enough

Returns
virtual bool Expansions.Serenity.BaseServo.CanBeDetached ( )
inlinevirtual

Returns true if not moving.

Returns

Implements IConstruction.

virtual bool Expansions.Serenity.BaseServo.CanBeOffset ( )
inlinevirtual

Returns true if not moving.

Returns

Implements IConstruction.

virtual bool Expansions.Serenity.BaseServo.CanBeRotated ( )
inlinevirtual

Returns true if not moving.

Returns

Implements IConstruction.

void Expansions.Serenity.BaseServo.CreateServoRigidbody ( )
inlineprotected

If the movingPartObject is set will set movingPartRB or add a RigidBody to the movingPartObject and set it's parameters and mass.

float Expansions.Serenity.BaseServo.currentTransformAngle ( )
inlineprotected
float Expansions.Serenity.BaseServo.currentTransformPosition ( )
inlineprotected
override void Expansions.Serenity.BaseServo.DemoteToPhysicslessPart ( )
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.

void Expansions.Serenity.BaseServo.DisengageMotor ( )
inline

Disengage the motor drive

void Expansions.Serenity.BaseServo.DisengageServoLock ( )
inline

Disengage the Lock on this robotic part

void Expansions.Serenity.BaseServo.EngageMotor ( )
inline

Engage the motor drive

bool Expansions.Serenity.BaseServo.EngageServoLock ( )
inline

Engage the Lock on this robotic part

Returns
True if the part was stopped and the lock was engaged
void Expansions.Serenity.BaseServo.FixedUpdate ( )
inlineprotected

Handles resource requests

AxisFieldLimit Expansions.Serenity.BaseServo.GetAxisFieldLimit ( string  fieldName)
inline

Get an AxisFieldLimit for a specific axisField

Returns
Should return null if no limited field by that name

Implements IAxisFieldLimits.

List<AxisFieldLimit> Expansions.Serenity.BaseServo.GetAxisFieldLimits ( )
inline

Get the list of AxisFieldLimit for AxisFields with hard/soft limits

Implements IAxisFieldLimits.

List<PartResourceDefinition> Expansions.Serenity.BaseServo.GetConsumedResources ( )
inline

Implements IResourceConsumer.

abstract float Expansions.Serenity.BaseServo.GetFrameDisplacement ( )
protectedpure virtual
Vector2 Expansions.Serenity.BaseServo.GetHardLimits ( string  fieldName)
inline

Get the HardLimits for the named field

Returns
Should return null if no limited field by that name

Implements IAxisFieldLimits.

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

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

Returns

Reimplemented from PartModule.

Reimplemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.

Vector3 Expansions.Serenity.BaseServo.GetMainAxis ( )
inline
float Expansions.Serenity.BaseServo.GetModuleCost ( float  defaultCost,
ModifierStagingSituation  sit 
)
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)

Returns

Implements IPartCostModifier.

ModifierChangeWhen Expansions.Serenity.BaseServo.GetModuleCostChangeWhen ( )
inline

Return under which circumstances the modulecost changes

Returns

Implements IPartCostModifier.

float Expansions.Serenity.BaseServo.GetModuleMass ( float  defaultMass,
ModifierStagingSituation  sit 
)
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)

Returns

Implements IPartMassModifier.

ModifierChangeWhen Expansions.Serenity.BaseServo.GetModuleMassChangeWhen ( )
inline

Return under which circumstances the modulemass changes

Returns

Implements IPartMassModifier.

Vector2 Expansions.Serenity.BaseServo.GetSoftLimits ( string  fieldName)
inline

Get the SoftLimits for the named field

Returns
Should return null if no limited field by that name

Implements IAxisFieldLimits.

bool Expansions.Serenity.BaseServo.HasAxisFieldLimit ( string  fieldName)
inline

Does this partmodule have an AxisField of this name with hard/soft limits

Implements IAxisFieldLimits.

bool Expansions.Serenity.BaseServo.HasAxisFieldLimits ( )
inline

Does this partmodule have any AxisFields with hard/soft limits

Implements IAxisFieldLimits.

abstract void Expansions.Serenity.BaseServo.InitAxisFieldLimits ( )
protectedpure virtual
void Expansions.Serenity.BaseServo.InitJoint ( )
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.

bool Expansions.Serenity.BaseServo.IsJointUnlocked ( )
inline

Return the part joint state

Returns

Implements IJointLockState.

abstract bool Expansions.Serenity.BaseServo.IsMoving ( )
protectedpure virtual
void Expansions.Serenity.BaseServo.ManuallyModifyEngaged ( object  field)
inlineprotected
void Expansions.Serenity.BaseServo.ModifyEngaged ( object  field)
inlineprotected
void Expansions.Serenity.BaseServo.ModifyLocked ( object  field)
inlineprotected
void Expansions.Serenity.BaseServo.ModifyServo ( object  field)
inlineprotected

Call this to Update the Servo rotation. Will Call VisualizeServo or OnUpdateServo.

Parameters
field
void Expansions.Serenity.BaseServo.MotorOffAction ( KSPActionParam  param)
inlineprotected
void Expansions.Serenity.BaseServo.MotorOnAction ( KSPActionParam  param)
inlineprotected
GameObject Expansions.Serenity.BaseServo.MovingObject ( )
inline
Rigidbody Expansions.Serenity.BaseServo.NodeRigidBody ( AttachNode  node)
inline
override void Expansions.Serenity.BaseServo.OnAwake ( )
inlinevirtual

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

Reimplemented from PartModule.

override void Expansions.Serenity.BaseServo.OnCopy ( PartModule  fromModule)
inlinevirtual

Use OnCopy to copy any additional data from the PartModule provided

Parameters
fromModule

Reimplemented from PartModule.

Reimplemented in Expansions.Serenity.ModuleRoboticServoHinge, and Expansions.Serenity.ModuleRoboticRotationServo.

virtual void Expansions.Serenity.BaseServo.OnDestroy ( )
inlineprotectedvirtual
void Expansions.Serenity.BaseServo.OnEditorCompoundPartLinked ( CompoundPart  linkedPart)
inlineprotected
void Expansions.Serenity.BaseServo.OnEditorPartPicked ( Part  pickedPart)
inlineprotected
void Expansions.Serenity.BaseServo.OnEditorPartPlaced ( Part  placedPart)
inlineprotected
abstract new void Expansions.Serenity.BaseServo.OnFixedUpdate ( )
protectedpure virtual
abstract void Expansions.Serenity.BaseServo.OnJointInit ( bool  goodSetup)
protectedpure virtual
override void Expansions.Serenity.BaseServo.OnLoad ( ConfigNode  node)
inlinevirtual

Use OnLoad to load any additional data from the ConfigNode provided

Parameters
node

Reimplemented from PartModule.

abstract void Expansions.Serenity.BaseServo.OnModifyServo ( )
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.

Returns

Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoPiston, and Expansions.Serenity.ModuleRoboticServoRotor.

void Expansions.Serenity.BaseServo.OnPartMenuClose ( Part  inpPart)
inlineprotected
void Expansions.Serenity.BaseServo.OnPartMenuOpen ( UIPartActionWindow  window,
Part  inpPart 
)
inlineprotected
abstract void Expansions.Serenity.BaseServo.OnPostStartJointInit ( )
protectedpure virtual
abstract void Expansions.Serenity.BaseServo.OnPreModifyServo ( )
pure virtual

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

Returns

Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.

override void Expansions.Serenity.BaseServo.OnSave ( ConfigNode  node)
inlinevirtual

Use OnSave to serialize additional module information into the ConfigNode provided

Parameters
node

Reimplemented from PartModule.

virtual void Expansions.Serenity.BaseServo.OnSaveShip ( ShipConstruct  ship)
inlineprotectedvirtual

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

Parameters
ship

Reimplemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.

abstract void Expansions.Serenity.BaseServo.OnServoLockApplied ( )
protectedpure virtual
abstract void Expansions.Serenity.BaseServo.OnServoLockRemoved ( )
protectedpure virtual
abstract void Expansions.Serenity.BaseServo.OnServoMotorDisengaged ( )
protectedpure virtual
abstract void Expansions.Serenity.BaseServo.OnServoMotorEngaged ( )
protectedpure virtual
override void Expansions.Serenity.BaseServo.OnStart ( PartModule.StartState  state)
inline
override void Expansions.Serenity.BaseServo.OnStartBeforePartAttachJoint ( StartState  state)
inlinevirtual

Called in flight scene in Part.Start just before the Part attachnode joints are created.

Parameters
state

Reimplemented from PartModule.

abstract void Expansions.Serenity.BaseServo.OnVisualizeServo ( bool  rotateBase)
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.

Returns

Implemented in Expansions.Serenity.ModuleRoboticServoHinge, Expansions.Serenity.ModuleRoboticRotationServo, Expansions.Serenity.ModuleRoboticServoRotor, and Expansions.Serenity.ModuleRoboticServoPiston.

void Expansions.Serenity.BaseServo.PostStartInitJoint ( )
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.

override void Expansions.Serenity.BaseServo.PromoteToPhysicalPart ( )
inlinevirtual

This method will be called from Part class PromoteToPhysicalPart when the part is being converted from physicsless to physical part.

Reimplemented from PartModule.

virtual void Expansions.Serenity.BaseServo.RecurseAttachNodeUpdate ( Part  p)
inlineprotectedvirtual

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.

Parameters
p
virtual void Expansions.Serenity.BaseServo.RecurseCoordUpdate ( Part  p,
Part  rootPart 
)
inlineprotectedvirtual

Sets Part orgPos and orgRot. Is called at the end of ApplyCoordsUpdate().

Parameters
pThe Part
destPosThe Destination Position
destRotThe Destination Rotation
pivotThe pivot position
abstract void Expansions.Serenity.BaseServo.ResetLaunchPosition ( )
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.

void Expansions.Serenity.BaseServo.ResetPosition ( KSPActionParam  param)
inlineprotected
void Expansions.Serenity.BaseServo.ResetPosition ( )
inlineprotected
void Expansions.Serenity.BaseServo.RestoreSpanningPartTargets ( )
inlineprotected
void Expansions.Serenity.BaseServo.SaveSpanningPartTargets ( )
inlineprotected
void Expansions.Serenity.BaseServo.ServoDisgageLockAction ( KSPActionParam  param)
inlineprotected
void Expansions.Serenity.BaseServo.ServoEngageLockAction ( KSPActionParam  param)
inlineprotected
bool Expansions.Serenity.BaseServo.ServoTransformCollider ( string  colName)
inline
void Expansions.Serenity.BaseServo.SetHardLimits ( string  fieldName,
Vector2  newLimits 
)
inline

Set the HardLimits for the named field

Implements IAxisFieldLimits.

abstract void Expansions.Serenity.BaseServo.SetInitialDisplacement ( )
protectedpure virtual
virtual void Expansions.Serenity.BaseServo.SetLaunchPosition ( float  val)
inlinevirtual

Save the launch position.

Parameters
valTarget extension/angle to be saved as launchPosition.
void Expansions.Serenity.BaseServo.SetServoMass ( )
inlineprotected
void Expansions.Serenity.BaseServo.SetSoftLimits ( string  fieldName,
Vector2  newLimits 
)
inline

set the HardLimits for the named field

Implements IAxisFieldLimits.

void Expansions.Serenity.BaseServo.ToggleMotorAction ( KSPActionParam  param)
inlineprotected
void Expansions.Serenity.BaseServo.ToggleServoLockedAction ( KSPActionParam  param)
inlineprotected
virtual void Expansions.Serenity.BaseServo.Update ( )
inlineprotectedvirtual
abstract void Expansions.Serenity.BaseServo.UpdateAxisFieldHardLimit ( string  fieldName,
Vector2  newlimits 
)
protectedpure virtual
void Expansions.Serenity.BaseServo.UpdateAxisFieldLimit ( string  fieldName,
Vector2  hardLimits,
Vector2  softLimits 
)
inlineprotected
abstract void Expansions.Serenity.BaseServo.UpdateAxisFieldSoftLimit ( string  fieldName,
Vector2  newlimits 
)
protectedpure virtual
float Expansions.Serenity.BaseServo.UpdateFieldLimits ( BaseAxisField  axisField,
Vector2  newlimits,
float  currentValue,
UI_FloatRange  uiField = null 
)
inlineprotected

Change a fields limits and update the associated bits

Parameters
axisFieldThe field whose limits are being changed
newlimitsThe new limits
currentValueThe current value
uiFieldThe UI_FloatRange that relates to this field
Returns
The value clamped between the new limits
virtual void Expansions.Serenity.BaseServo.UpdatePAWUI ( UI_Scene  currentScene)
inlineprotectedvirtual
void Expansions.Serenity.BaseServo.VisualizeServo ( bool  moveChildren)
inlineprotected

Member Data Documentation

List<AttachNode> Expansions.Serenity.BaseServo.attachNodes
protected
Vector3 Expansions.Serenity.BaseServo.axis
protected
DictionaryValueList<string, AxisFieldLimit> Expansions.Serenity.BaseServo.axisFieldLimits
protected
GameObject Expansions.Serenity.BaseServo.basePartObject
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).

Quaternion Expansions.Serenity.BaseServo.cachedStartingRotation
protected
float Expansions.Serenity.BaseServo.cachedStartingRotationOffset
protected
float Expansions.Serenity.BaseServo.connectedMassScale = 1f
float Expansions.Serenity.BaseServo.driveUnit
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.

bool Expansions.Serenity.BaseServo.hasEnoughResources
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

Transform Expansions.Serenity.BaseServo.jointParent
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.

float Expansions.Serenity.BaseServo.lockAngle
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.

bool Expansions.Serenity.BaseServo.motorManualDisengaged = false
protected
float Expansions.Serenity.BaseServo.motorOutput
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

GameObject Expansions.Serenity.BaseServo.movingPartObject
protected
Rigidbody Expansions.Serenity.BaseServo.movingPartRB
protected
string Expansions.Serenity.BaseServo.OutputUnit
protected
bool Expansions.Serenity.BaseServo.partIsPhysicsLess = false
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.

Vector3 Expansions.Serenity.BaseServo.pivot
protected
bool Expansions.Serenity.BaseServo.prevServoIsLocked
protected
bool Expansions.Serenity.BaseServo.prevServoIsMotorized
protected
bool Expansions.Serenity.BaseServo.prevServoMotorIsEngaged
protected
double Expansions.Serenity.BaseServo.rate = 0d
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

bool Expansions.Serenity.BaseServo.servoIsBraking = false
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

ConfigurableJoint Expansions.Serenity.BaseServo.servoJoint
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

UI_FloatRange Expansions.Serenity.BaseServo.servoMotorLimitField
protected
float Expansions.Serenity.BaseServo.servoMotorSize = 100f

Lowers the size of the servo in editor scene as you build

UI_FloatRange Expansions.Serenity.BaseServo.servoMotorSizeField
protected
string Expansions.Serenity.BaseServo.servoName = "Servo_0"

The Name of the Servo

Matrix4x4 Expansions.Serenity.BaseServo.servoParentTransform
protected

This is the transform from the servo part FoR (ie, the moving part's parent's FoR) to the part FoR

Matrix4x4 Expansions.Serenity.BaseServo.servoParentTransformInverse
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)

string [] Expansions.Serenity.BaseServo.servoSrfMeshes
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

Quaternion Expansions.Serenity.BaseServo.targetRotation
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.

Property Documentation

float Expansions.Serenity.BaseServo.CurrentVelocityLimit
get

The current veloctiy limit of the joint.

bool Expansions.Serenity.BaseServo.HasEnoughResources
get

Are there enough resources to keep the servo going?

Callback<AxisFieldLimit> Expansions.Serenity.BaseServo.LimitsChanged
getset
PartJoint Expansions.Serenity.BaseServo.pJoint
getset

This is the Part Joint (Part.attachJoint)

bool Expansions.Serenity.BaseServo.ServoInitComplete
get

Set to true once the Servo has completed Initialization at start.


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