Module FueledEngine

Abstract class to define functions common to fueled engines.

Element class:

Extends: Element > Engine

Functions

activate () Start the engine at full power (works only when run inside a cockpit or under remote control).
deactivate () Stops the engine (works only when run inside a cockpit or under remote control).
isActive () Checks if the engine is active.
getState () Deprecated: Returns the activation state of the engine.
toggle () Toggle the state of the engine.
setThrust (thrust) Set the thrust of the engine.
getThrust () Returns the current thrust of the engine.
getMaxThrust () Returns the maximal thrust the engine can deliver in principle, under optimal conditions.
getCurrentMinThrust () Returns the minimal thrust the engine can deliver at the moment (can be more than zero), which will depend on various conditions like atmospheric density, obstruction, orientataion, etc.
getCurrentMaxThrust () Returns the maximal thrust the engine can deliver at the moment, which might depend on various conditions like atmospheric density, obstruction, orientataion, etc.
getMaxThrustEfficiency () Returns the ratio between the current maximum thrust and the optimal maximum thrust.
isTorqueEnabled () Checks if the torque generation is enabled on the engine.
enableTorque (state) Sets the torque generation state on the engine.
getThrustAxis () Returns the engine thrust direction in construct local coordinates.
getTorqueAxis () Returns the engine torque axis in construct local coordinates.
getWorldThrustAxis () Returns the engine thrust direction in world coordinates.
getWorldTorqueAxis () Returns the engine torque axis in world coordinates.
isOutOfFuel () Checks if the engine is out of fuel.
getFuelId () Returns the item ID of the fuel currently used by the engine.
getFuelTankId () Returns the local ID of the fueltank linked to the engine.
hasBrokenFuelTank () Deprecated: Is the engine linked to a broken fuel tank?
hasFunctionalFuelTank () Checks if the engine is linked to a functional fuel tank (not broken or colliding).
getCurrentFuelRate () Returns the engine fuel consumption rate per newton of thrust delivered per second.
getFuelRateEfficiency () Returns the ratio between the current fuel rate and the theoretical nominal fuel rate.
getFuelConsumption () Returns the fuel consumption rate.
getWarmupTime () Returns the T50: the time needed for the engine to reach 50% of its maximal thrust.


Functions

activate ()
Start the engine at full power (works only when run inside a cockpit or under remote control).
deactivate ()
Stops the engine (works only when run inside a cockpit or under remote control).
isActive ()
Checks if the engine is active.

Returns:

    0/1 1 when the engine is on.
getState ()
Deprecated: Returns the activation state of the engine.

This method is deprecated: isActive should be used instead

Returns:

    0/1 1 when the engine is on, 0 otherwise.

See also:

toggle ()
Toggle the state of the engine.
setThrust (thrust)
Set the thrust of the engine.

Parameters:

  • thrust float The engine thrust in newtons (limited by the maximum thrust).
getThrust ()
Returns the current thrust of the engine.

Returns:

    float The current thrust of the engine in newtons.
getMaxThrust ()
Returns the maximal thrust the engine can deliver in principle, under optimal conditions. Note that the actual current max thrust will most of the time be less than the max thrust.

Returns:

    float The base max thrust of the engine in newtons.
getCurrentMinThrust ()
Returns the minimal thrust the engine can deliver at the moment (can be more than zero), which will depend on various conditions like atmospheric density, obstruction, orientataion, etc. Most of the time, this will be 0 but it can be greater than 0.

Returns:

    float The current min engine thrust in newtons.
getCurrentMaxThrust ()
Returns the maximal thrust the engine can deliver at the moment, which might depend on various conditions like atmospheric density, obstruction, orientataion, etc. The actual thrust will be anything below this maxThrust, which defines the current max capability of the engine.

Returns:

    float The current max engine thrust in newtons.
getMaxThrustEfficiency ()
Returns the ratio between the current maximum thrust and the optimal maximum thrust.

Returns:

    float Usually 1 but can be lower for certain engines.
isTorqueEnabled ()
Checks if the torque generation is enabled on the engine.

Returns:

    0/1 1 if the torque is enabled on the engine.
enableTorque (state)
Sets the torque generation state on the engine.

Parameters:

  • state bool True to enable the torque generation.
getThrustAxis ()
Returns the engine thrust direction in construct local coordinates.

Returns:

    vec3 The engine thrust direction vector in construct local coordinates.
getTorqueAxis ()
Returns the engine torque axis in construct local coordinates.

Returns:

    vec3 The torque axis vector in construct local coordinates.
getWorldThrustAxis ()
Returns the engine thrust direction in world coordinates.

Returns:

    vec3 The engine thrust direction vector in world coordinates.
getWorldTorqueAxis ()
Returns the engine torque axis in world coordinates.

Returns:

    vec3 The torque axis vector in world coordinates.
isOutOfFuel ()
Checks if the engine is out of fuel.

Returns:

    0/1 1 when there is no fuel left, 0 otherwise.
getFuelId ()
Returns the item ID of the fuel currently used by the engine.

Returns:

    int The item ID of the fuel currently used.
getFuelTankId ()
Returns the local ID of the fueltank linked to the engine.

Returns:

    int The local ID of the fueltank.
hasBrokenFuelTank ()
Deprecated: Is the engine linked to a broken fuel tank?

This method is deprecated: hasFunctionalFuelTank should be used instead

Returns:

    bool 1 when linked tank is broken, 0 otherwise.

See also:

hasFunctionalFuelTank ()
Checks if the engine is linked to a functional fuel tank (not broken or colliding).

Returns:

    0/1 1 when the linked tank is functional, 0 otherwise.
getCurrentFuelRate ()
Returns the engine fuel consumption rate per newton of thrust delivered per second.

Returns:

    float The current rate of fuel consumption in m3/(N.s).
getFuelRateEfficiency ()
Returns the ratio between the current fuel rate and the theoretical nominal fuel rate.

Returns:

    float Usually 1 but can be higher for certain engines at certain speeds.
getFuelConsumption ()
Returns the fuel consumption rate.

Returns:

    float The rate of fuel consumption in m3/s.
getWarmupTime ()
Returns the T50: the time needed for the engine to reach 50% of its maximal thrust. All engines do not instantly reach the thrust that is set for them; they can take time to "warm up" to the final value.

Returns:

    float The time to half thrust in seconds.
generated by LDoc 1.5.0 Last updated 2024-09-27 15:22:47