Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Expansions.Serenity.ControlledAxis Class Reference

Class that manages a KSPBaseField that is being driven by ModuleRobiticController More...

Inheritance diagram for Expansions.Serenity.ControlledAxis:
Expansions.Serenity.ControlledBase IConfigNode

Public Member Functions

void AlignCurveEnds ()
 Align the curve endpoint value and tangent with the start one to help smooth looping behaviour More...
 
void ClampAllPointValues ()
 Clamp all the point values inside the limits More...
 
void ClampPointValue (int index)
 Clamp all the point values inside the limits More...
 
 ControlledAxis (ControlledAxis sourceAxis)
 
 ControlledAxis (Part part, PartModule module, BaseAxisField axisField, ModuleRoboticController controller)
 
 ControlledAxis ()
 
void InvertCurve ()
 Invert the timeValue curve between the min and max axis More...
 
void PresetFlat ()
 Set the axis to be a flat line at the mid-point More...
 
void PresetRevSaw (float cycles, float phase)
 Set the axis to be a reverse sawtooth wave More...
 
void PresetSaw (float cycles, float phase)
 Set the axis to be a sawtooth wave More...
 
void PresetSine (float cycles, float phase)
 Set the axis to be a sine wave More...
 
void PresetSquare (float cycles, float phase)
 Set the axis to be a square wave More...
 
void PresetTriangle (float cycles, float phase)
 Set the axis to be a triangle wave More...
 
void RescaleCurveTime (float adjustmentRatio, float minSpace=0.01f)
 Scale the time axis of the points in a curve without changing the length More...
 
void ReverseCurve ()
 Reverse the timeValue curve direction More...
 
void UpdateFieldValue (float time, float valueMultiple=1f, bool updateSymmetryPartners=true)
 Update the field to a new value based on the time provided More...
 
void UpdatePreset (float cycles, float phase)
 Set the axis to be a reverse sawtooth wave More...
 
void UpdateSoftLimits (Vector2 newLimits, bool updateSymmetryPartners=true)
 
- Public Member Functions inherited from Expansions.Serenity.ControlledBase
void ChangeSymmetryMaster (Part newPart)
 Change the part that is listed as the one this axis is connected to to be another of its symmetry partners More...
 
void Load (ConfigNode node)
 
void Save (ConfigNode node)
 
void SetPartNickName (string newNickName)
 

Public Attributes

FloatCurve timeValue
 curve of value vs time - time is a 0->1 More...
 

Protected Member Functions

override void AddSymmetryPart (Part part)
 Called by base class when rebuilding symmetry list More...
 
override void ClearSymmetryLists ()
 Called by base class to clear different list types in child classes More...
 
override bool OnAssignReferenceVars ()
 Update all the reference vars More...
 
override bool OnChangeSymmetryMaster (Part newPart, out uint oldPartId)
 Change the part that is listed as the one this axis is connected to to be another of its symmetry partners More...
 
override void OnLoad (ConfigNode node)
 
override void OnSave (ConfigNode node)
 

Properties

BaseAxisField AxisField [get, set]
 Reference to Field for this axis More...
 
float axisMax [get]
 maximum value for the Axis More...
 
float axisMin [get]
 minimum value for the Axis More...
 
- Properties inherited from Expansions.Serenity.ControlledBase
ModuleRoboticController Controller [get, set]
 Reference to Controller for this axis More...
 
PartModule Module [get, set]
 Reference to PartModule for this axis More...
 
Part Part [get, set]
 Reference to part for this axis More...
 
string PartNickName [get]
 friendly text for a controlled axis More...
 
uint PartPersistentId [get]
 Helper to get the part persistentId More...
 
uint PersistentActionId [get]
 
List< PartSymmetryParts [get]
 The parts that are in symmetry with this one More...
 

Detailed Description

Class that manages a KSPBaseField that is being driven by ModuleRobiticController

Constructor & Destructor Documentation

Expansions.Serenity.ControlledAxis.ControlledAxis ( ControlledAxis  sourceAxis)
inline
Expansions.Serenity.ControlledAxis.ControlledAxis ( Part  part,
PartModule  module,
BaseAxisField  axisField,
ModuleRoboticController  controller 
)
inline
Expansions.Serenity.ControlledAxis.ControlledAxis ( )
inline

Member Function Documentation

override void Expansions.Serenity.ControlledAxis.AddSymmetryPart ( Part  part)
inlineprotectedvirtual

Called by base class when rebuilding symmetry list

Parameters
partTHe part to add to the symmetry list

Implements Expansions.Serenity.ControlledBase.

void Expansions.Serenity.ControlledAxis.AlignCurveEnds ( )
inline

Align the curve endpoint value and tangent with the start one to help smooth looping behaviour

void Expansions.Serenity.ControlledAxis.ClampAllPointValues ( )
inline

Clamp all the point values inside the limits

void Expansions.Serenity.ControlledAxis.ClampPointValue ( int  index)
inline

Clamp all the point values inside the limits

override void Expansions.Serenity.ControlledAxis.ClearSymmetryLists ( )
inlineprotectedvirtual

Called by base class to clear different list types in child classes

Implements Expansions.Serenity.ControlledBase.

void Expansions.Serenity.ControlledAxis.InvertCurve ( )
inline

Invert the timeValue curve between the min and max axis

override bool Expansions.Serenity.ControlledAxis.OnAssignReferenceVars ( )
inlineprotectedvirtual

Update all the reference vars

Returns
True if we found the axis field and did it

Implements Expansions.Serenity.ControlledBase.

override bool Expansions.Serenity.ControlledAxis.OnChangeSymmetryMaster ( Part  newPart,
out uint  oldPartId 
)
inlineprotectedvirtual

Change the part that is listed as the one this axis is connected to to be another of its symmetry partners

Call this BEFORE the master part is deleted to maintain the symmetry groups

Parameters
newPartPart that will take over the role as symmetry master

Implements Expansions.Serenity.ControlledBase.

override void Expansions.Serenity.ControlledAxis.OnLoad ( ConfigNode  node)
inlineprotectedvirtual
override void Expansions.Serenity.ControlledAxis.OnSave ( ConfigNode  node)
inlineprotectedvirtual
void Expansions.Serenity.ControlledAxis.PresetFlat ( )
inline

Set the axis to be a flat line at the mid-point

void Expansions.Serenity.ControlledAxis.PresetRevSaw ( float  cycles,
float  phase 
)
inline

Set the axis to be a reverse sawtooth wave

Parameters
cyclesHow many times should the pattern repeat across the duartion
phaseHow far should the starting point be offset as a percentage
void Expansions.Serenity.ControlledAxis.PresetSaw ( float  cycles,
float  phase 
)
inline

Set the axis to be a sawtooth wave

Parameters
cyclesHow many times should the pattern repeat across the duartion
phaseHow far should the starting point be offset as a percentage
void Expansions.Serenity.ControlledAxis.PresetSine ( float  cycles,
float  phase 
)
inline

Set the axis to be a sine wave

Parameters
cyclesHow many times should the pattern repeat across the duartion
phaseHow far should the starting point be offset as a percentage
void Expansions.Serenity.ControlledAxis.PresetSquare ( float  cycles,
float  phase 
)
inline

Set the axis to be a square wave

Parameters
cyclesHow many times should the pattern repeat across the duartion
phaseHow far should the starting point be offset as a percentage
void Expansions.Serenity.ControlledAxis.PresetTriangle ( float  cycles,
float  phase 
)
inline

Set the axis to be a triangle wave

Parameters
cyclesHow many times should the pattern repeat across the duartion
phaseHow far should the starting point be offset as a percentage
void Expansions.Serenity.ControlledAxis.RescaleCurveTime ( float  adjustmentRatio,
float  minSpace = 0.01f 
)
inline

Scale the time axis of the points in a curve without changing the length

Parameters
adjustmentRatioHow to calculate the new position of each keyframes timeValue
minSpaceThe min distance between points when the adjustmentRatio is spreading the points apart and we hit the end of the curve
void Expansions.Serenity.ControlledAxis.ReverseCurve ( )
inline

Reverse the timeValue curve direction

void Expansions.Serenity.ControlledAxis.UpdateFieldValue ( float  time,
float  valueMultiple = 1f,
bool  updateSymmetryPartners = true 
)
inline

Update the field to a new value based on the time provided

Parameters
timeTime along the stored floatcurve
valueMultipleA multiplier in case the provided value needs scaling
updateSymmetryPartnersTrue to update the symmetry partners as wellas this one
void Expansions.Serenity.ControlledAxis.UpdatePreset ( float  cycles,
float  phase 
)
inline

Set the axis to be a reverse sawtooth wave

Parameters
cyclesHow many times should the pattern repeat across the duartion
phaseHow far should the starting point be offset as a percentage
void Expansions.Serenity.ControlledAxis.UpdateSoftLimits ( Vector2  newLimits,
bool  updateSymmetryPartners = true 
)
inline

Member Data Documentation

FloatCurve Expansions.Serenity.ControlledAxis.timeValue

curve of value vs time - time is a 0->1

Property Documentation

BaseAxisField Expansions.Serenity.ControlledAxis.AxisField
getset

Reference to Field for this axis

float Expansions.Serenity.ControlledAxis.axisMax
get

maximum value for the Axis

float Expansions.Serenity.ControlledAxis.axisMin
get

minimum value for the Axis


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