Skip to main content

Class: MapPointerJoystickHandler

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Components/Map/MapPointerJoystickHandler.ts:21

A handler for joystick inputs that control the movement of a map pointer. Consumes inputs and converts them into displacement vectors for the map pointer. Supports input acceleration.

Constructors​

Constructor​

new MapPointerJoystickHandler(accelTimeThreshold): MapPointerJoystickHandler

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Components/Map/MapPointerJoystickHandler.ts:36

Constructor.

Parameters​

ParameterTypeDefault valueDescription
accelTimeThresholdnumberMapPointerJoystickHandler.DEFAULT_ACCEL_TIME_THRESHOLDThe maximum time, in milliseconds, between inputs required to trigger acceleration. Defaults to MapPointerJoystickHandler.DEFAULT_ACCEL_TIME_THRESHOLD.

Returns​

MapPointerJoystickHandler

Methods​

onInput()​

onInput(direction, out): Float64Array

Defined in: src/workingtitle-instruments-g3000/html_ui/Shared/Components/Map/MapPointerJoystickHandler.ts:47

Handles a joystick input, converting it into a displacement vector for the map pointer.

Parameters​

ParameterTypeDescription
directionMapPointerJoystickDirectionThe direction of the input.
outFloat64ArrayThe vector to which to write the result.

Returns​

Float64Array

The displacement vector for the map pointer commanded by the input.