A PartModule that can be configured to behave like many different kinds of engines. All stock propulsion systems except for RCS are implemented through ModuleEngines. More...
Classes | |
class | Propellant |
A class that represents the resource requirements of an engine. More... | |
Public Member Functions | |
ModuleEngines () | |
void | AutoPlaceFXGroup (FXGroup group, Transform thruster) |
void | BurstFlameoutGroups () |
float | CalculateThrust () |
void | EngineExhaustDamage () |
void | FixedUpdate () |
override string | GetInfo () |
The return value of this function appears in the part's description in the editor. More... | |
override void | OnActive () |
This function is called once when the part gets activated. More... | |
override void | OnAwake () |
This function gets called only once, during the KSP loading screen. See the Unity documentation on Awake for more information. More... | |
void | OnCenterOfThrustQuery (CenterOfThrustQuery qry) |
override void | OnLoad (ConfigNode node) |
This function is called to initialize the part. The ConfigNode contains the parameters of the module as specified in the part.cfg file, or as you last saved them in OnSave. More... | |
override void | OnSave (ConfigNode node) |
This function is called when the game is saved to let the part save persistent data. Add any data you want to persist to the ConfigNode. The ConfigNode will then be saved as part of persistent.sfs. When the game is resumed, you can then read this data back out in OnLoad. More... | |
override void | OnStart (PartModule.StartState state) |
Called when the flight starts, or when the part is created in the editor. OnStart will be called before OnUpdate or OnFixedUpdate are ever called. More... | |
double | RequestPropellant (double mass) |
void | SetPowerGroupsActive (bool active) |
void | SetRunningGroupsActive (bool active) |
void | SetupFXGroups () |
void | SetupPropellant () |
void | UpdateThrottle () |
Public Member Functions inherited from PartModule | |
PartModule () | |
void | Load (ConfigNode node) |
virtual void | OnFixedUpdate () |
This function gets called once every Unity FixedUpdate cycle (once per physics frame) once the part has been activated. If you want to be called even if the part has not been activated, define a function called void FixedUpdate() instead of overriding OnFixedUpdate More... | |
virtual void | OnInactive () |
When does this get called? More... | |
virtual void | OnUpdate () |
Called once per Unity Update cycle once the part has been activated. If you want to be called even if the part has not been activated, define a function called void Update() instead of overriding OnFixedUpdate. More... | |
void | Save (ConfigNode node) |
Public Attributes | |
bool | allowRestart |
bool | allowShutdown |
FloatCurve | atmosphereCurve |
Represents the specific impulse (Isp) of the engine as a function of altitude. To get the Isp at a certain height h (in meters), use More... | |
bool | autoPositionFX |
float | currentThrottle |
The current internal throttle of the engine, which may be different from the current throttle set by the player if useEngineResponseTime is true. More... | |
float | engineAccelerationSpeed |
How quickly the engine spools up when the user-set throttle is higher than currentThrottle . More... | |
float | engineDecelerationSpeed |
How quickly the engine spools down when the user-set throttle is higher than currentThrottle . More... | |
bool | EngineIgnited |
Whether the engine has ever been turned on? More... | |
bool | engineShutdown |
bool | exhaustDamage |
Whether the engine's exhaust will damage parts that it hits. A ray is cast back along the engine's thrust vector and if that ray hits a part then that part gets heated up, and may explode if it exceeds its maximum temperature. More... | |
float | finalThrust |
bool | flameout |
float | fuelFlowGui |
string | fxGroupPrefix |
Vector3 | fxOffset |
float | G |
float | heatProduction |
float | ignitionThreshold |
float | maxThrust |
The thrust this engine produces at maximum throttle. More... | |
float | minThrust |
The thrust this engine produces at minimum throttle. More... | |
float | mixtureDensity |
List< ModuleEngines.Propellant > | propellants |
float | realIsp |
The current specific impulse of this engine, in seconds. More... | |
float | requestedThrottle |
float | requestedThrust |
bool | staged |
string | status |
string | statusL2 |
bool | throttleLocked |
Whether this engine always produces maximum thrust once activated (like solid rocket boosters). More... | |
List< Transform > | thrustTransforms |
These transforms store the locations and directions at which the thrust this engine generates is applied to the part. Which component of the transform rotation gives the thrust vector? More... | |
string | thrustVectorTransformName |
bool | useEngineResponseTime |
Whether the engine has a nonzero spool-up and spool-down time. More... | |
bool | useVelocityCurve |
Whether this engine's thrust varies with airspeed? More... | |
FloatCurve | velocityCurve |
How this engine's thrust varies with airspeed? More... | |
Public Attributes inherited from PartModule | |
bool | isEnabled |
string | moduleName |
ProtoPartModuleSnapshot | snapshot |
Properties | |
bool | getFlameoutState [get] |
If this is true, the engine is not producing thrust because it can't get enough resources. More... | |
bool | getIgnitionState [get] |
float | normalizedThrustOutput [get] |
Properties inherited from PartModule | |
BaseActionList | Actions [get] |
A list of KSPActions which can be added to action groups. More... | |
int | ClassID [get] |
A hash of ClassName ? More... | |
string | ClassName [get] |
In any subclass of PartModule, ClassName will be the name of the subclass. It gets set by the PartModule loading process. More... | |
BaseEventList | Events [get] |
A list of KSPEvents, which can be triggered by code or by the user through the part's right-click menu. More... | |
BaseFieldList | Fields [get] |
A list of the KSPFields which the module loads from the part.cfg file. More... | |
string | GUIName [get] |
Part | part [get, set] |
The Part to which this PartModule is attached. Use this to reference the part from your module code. More... | |
Vessel | vessel [get] |
The Vessel of the Part to which this PartModule is attached. More... | |
Additional Inherited Members | |
Public Types inherited from PartModule | |
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 } |
A StartState is passed on OnStart in order to provide the PartModule with some information about where it is starting up. More... | |
A PartModule that can be configured to behave like many different kinds of engines. All stock propulsion systems except for RCS are implemented through ModuleEngines.
ModuleEngines.ModuleEngines | ( | ) |
void ModuleEngines.AutoPlaceFXGroup | ( | FXGroup | group, |
Transform | thruster | ||
) |
void ModuleEngines.BurstFlameoutGroups | ( | ) |
float ModuleEngines.CalculateThrust | ( | ) |
void ModuleEngines.EngineExhaustDamage | ( | ) |
void ModuleEngines.FixedUpdate | ( | ) |
|
virtual |
The return value of this function appears in the part's description in the editor.
Reimplemented from PartModule.
|
virtual |
This function is called once when the part gets activated.
Reimplemented from PartModule.
|
virtual |
This function gets called only once, during the KSP loading screen. See the Unity documentation on Awake for more information.
Reimplemented from PartModule.
void ModuleEngines.OnCenterOfThrustQuery | ( | CenterOfThrustQuery | qry | ) |
|
virtual |
This function is called to initialize the part. The ConfigNode contains the parameters of the module as specified in the part.cfg file, or as you last saved them in OnSave.
node | A ConfigNode containing the module's parameters from part.cfg or persistent.sfs |
Reimplemented from PartModule.
|
virtual |
This function is called when the game is saved to let the part save persistent data. Add any data you want to persist to the ConfigNode. The ConfigNode will then be saved as part of persistent.sfs. When the game is resumed, you can then read this data back out in OnLoad.
node |
Reimplemented from PartModule.
|
virtual |
Called when the flight starts, or when the part is created in the editor. OnStart will be called before OnUpdate or OnFixedUpdate are ever called.
state | Some information about what situation the vessel is starting in. |
Reimplemented from PartModule.
double ModuleEngines.RequestPropellant | ( | double | mass | ) |
void ModuleEngines.SetPowerGroupsActive | ( | bool | active | ) |
void ModuleEngines.SetRunningGroupsActive | ( | bool | active | ) |
void ModuleEngines.SetupFXGroups | ( | ) |
void ModuleEngines.SetupPropellant | ( | ) |
void ModuleEngines.UpdateThrottle | ( | ) |
bool ModuleEngines.allowRestart |
bool ModuleEngines.allowShutdown |
FloatCurve ModuleEngines.atmosphereCurve |
Represents the specific impulse (Isp) of the engine as a function of altitude. To get the Isp at a certain height h (in meters), use
atmosphereCurve.Evaluate(h)
.
bool ModuleEngines.autoPositionFX |
float ModuleEngines.currentThrottle |
The current internal throttle of the engine, which may be different from the current throttle set by the player if useEngineResponseTime
is true.
float ModuleEngines.engineAccelerationSpeed |
How quickly the engine spools up when the user-set throttle is higher than currentThrottle
.
Each frame, if the user throttle is higher than the engine's currentThrottle
, currentThrottle
is updated according to the formula
engineAccelerationSpeed
has units of inverse seconds.
float ModuleEngines.engineDecelerationSpeed |
How quickly the engine spools down when the user-set throttle is higher than currentThrottle
.
Each frame, if the user throttle is lower than the engine's currentThrottle
, currentThrottle
is updated according to the formula
engineDecelerationSpeed
has units of inverse seconds.
bool ModuleEngines.EngineIgnited |
Whether the engine has ever been turned on?
bool ModuleEngines.engineShutdown |
bool ModuleEngines.exhaustDamage |
Whether the engine's exhaust will damage parts that it hits. A ray is cast back along the engine's thrust vector and if that ray hits a part then that part gets heated up, and may explode if it exceeds its maximum temperature.
float ModuleEngines.finalThrust |
bool ModuleEngines.flameout |
float ModuleEngines.fuelFlowGui |
string ModuleEngines.fxGroupPrefix |
Vector3 ModuleEngines.fxOffset |
float ModuleEngines.G |
float ModuleEngines.heatProduction |
float ModuleEngines.ignitionThreshold |
float ModuleEngines.maxThrust |
The thrust this engine produces at maximum throttle.
float ModuleEngines.minThrust |
The thrust this engine produces at minimum throttle.
float ModuleEngines.mixtureDensity |
List<ModuleEngines.Propellant> ModuleEngines.propellants |
The resources used by this engine, and their relative ratios.
float ModuleEngines.realIsp |
The current specific impulse of this engine, in seconds.
float ModuleEngines.requestedThrottle |
float ModuleEngines.requestedThrust |
bool ModuleEngines.staged |
string ModuleEngines.status |
string ModuleEngines.statusL2 |
bool ModuleEngines.throttleLocked |
Whether this engine always produces maximum thrust once activated (like solid rocket boosters).
List<Transform> ModuleEngines.thrustTransforms |
These transforms store the locations and directions at which the thrust this engine generates is applied to the part. Which component of the transform rotation gives the thrust vector?
string ModuleEngines.thrustVectorTransformName |
bool ModuleEngines.useEngineResponseTime |
Whether the engine has a nonzero spool-up and spool-down time.
If useEngineResponseTime
is true, then the engine does not spool up or down instantly when the throttle changes, but uses the engineAccelerationSpeed
and engineDecelerationSpeed
variables.
bool ModuleEngines.useVelocityCurve |
Whether this engine's thrust varies with airspeed?
FloatCurve ModuleEngines.velocityCurve |
How this engine's thrust varies with airspeed?
|
get |
If this is true, the engine is not producing thrust because it can't get enough resources.
|
get |
|
get |