Skip to main content

Generator

Inheritted classes

This component inherits classes. The following inherrited classes are:

A PowerComponent that generates power based on a rotational input.


Functions

getPower

Generator.getPower()

Returns the total power output of the generator.

Returns:

  • [ number ] The total power output.

getUsedPower

Generator.getUsedPower()

Returns the total power the output is using.

Returns:

  • [ number ] The total used power output.

setHandlePosition

Generator.setHandlePosition( handlePosition )

Sets the handle position. This adjusts how much power the generator is able to produce. A higher set resistance will allow the generator to procduce more power.

Arguments:

  • handlePosition [ number ] A value between 0 (minimum power output) and 1 (maximum power output).

getHandlePosition

Generator.getHandlePosition()

Retrieves the current handle position of the generator, indicating how much power it is set to produce.

Returns:

  • [ number ] A value between 0 and 1 representing the current handle position.