MoveController

MoveController

The controller is used for pure monitoring of Interactions events. It only stores interaction states and values for the motion calculation. The application of the motion to the corresponding object or the calculation and processing does not take place in the controller. This is done in the main render process of the WebGLRenderer in Exhibition#updateScene_.

Constructor

new MoveController(acceleration, friction)

Source:
Parameters:
Name Type Description
acceleration number | Map.<string, number>

List for defined acceleration values. It can be a single value or a list according to self-defined keys.

friction number | Map.<string, number>

List for defined friction values. It can be a single value or a list according to self-defined keys.

Extends

  • EventTarget

Members

(protected) acceleration_ :number|Map.<string, number>

Description:
  • List for defined acceleration values. These can be used for a smooth motion calculation. It can be a single value or a list according to self-defined keys.

Source:

List for defined acceleration values. These can be used for a smooth motion calculation. It can be a single value or a list according to self-defined keys.

Type:
  • number | Map.<string, number>

(private) activKeys_ :Array.<number>

Description:
  • List of the current active (pressed) keys

Source:

List of the current active (pressed) keys

Type:
  • Array.<number>

activeKeys

Description:
  • Getter

Source:

Getter

(protected) friction_ :number|Map.<string, number>

Description:
  • List for defined friction values. These can be used for a smooth motion calculation. It can be a single value or a list according to self-defined keys.

Source:

List for defined friction values. These can be used for a smooth motion calculation. It can be a single value or a list according to self-defined keys.

Type:
  • number | Map.<string, number>

gamepadAxes

Description:
  • Getter

Source:

Getter

(private) gamepadAxes_ :Map.<string, number>

Description:
  • List of the gamepad axes

Source:

List of the gamepad axes

Type:
  • Map.<string, number>

gamepadIsEnabled

Description:
  • Getter

Source:

Getter

(protected) gamepadIsEnabled_ :boolean

Description:
  • Specifies whether it should be possible that a gamepad can also be used.

Source:

Specifies whether it should be possible that a gamepad can also be used.

Type:
  • boolean

(private) gamepad_ :Gamepad

Description:
  • Gamepad instance

Source:

Gamepad instance

Type:
  • Gamepad

(private) interactionDistance_ :number

Description:
  • Interaction distance between two points which is used for the check of 2 finger pinch zooming

Source:

Interaction distance between two points which is used for the check of 2 finger pinch zooming

Type:
  • number

interactionEndPoints

Description:
  • Getter

Source:

Getter

(protected) interactionEndPoints_ :Array.<Coordinate>

Description:
  • Reference to the points where the interaction on the target ended.

Source:

Reference to the points where the interaction on the target ended.

Type:
  • Array.<Coordinate>

interactionMoveDistances

Description:
  • Getter

Source:

Getter

(protected) interactionMoveDistances_ :Array.<Coordinate>

Description:
  • Reference to distance of the current points to the last saved points during the interaction.

Source:

Reference to distance of the current points to the last saved points during the interaction.

Type:
  • Array.<Coordinate>

interactionMovePoints

Description:
  • Getter

Source:

Getter

(protected) interactionMovePoints_ :Array.<Coordinate>

Description:
  • Reference to the points during the interaction of the user.

Source:

Reference to the points during the interaction of the user.

Type:
  • Array.<Coordinate>

interactionStartPoints

Description:
  • Getter

Source:

Getter

(protected) interactionStartPoints_ :Array.<Coordinate>

Description:
  • Reference to the points where the interaction on the target started.

Source:

Reference to the points where the interaction on the target started.

Type:
  • Array.<Coordinate>

interactionType

Description:
  • Getter

Source:

Getter

(protected) interactionType_ :string

Description:
  • Saves whether it was mouse or touch interaction

Source:

Saves whether it was mouse or touch interaction

Type:
  • string

interactionZoomDistance

Description:
  • Getter

Source:

Getter

(private) interactionZoomDistance_ :number

Description:
  • Holds the value of the distance changes during interaction.

Source:

Holds the value of the distance changes during interaction.

Type:
  • number

(protected) isFocused_ :boolean

Description:
  • Value that indicates whether the window is in focus by the user.

Source:

Value that indicates whether the window is in focus by the user.

Type:
  • boolean

isMouseMoved

Description:
  • Getter

Source:

Getter

isMoving

Description:
  • Getter

Source:

Getter

isMovingDown

Description:
  • Getter

Source:

Getter

isMovingLeft

Description:
  • Getter

Source:

Getter

isMovingRight

Description:
  • Getter

Source:

Getter

isMovingUp

Description:
  • Getter

Source:

Getter

isZooming

Description:
  • Getter

Source:

Getter

isZoomingIn

Description:
  • Getter

Source:

Getter

isZoomingOut

Description:
  • Getter

Source:

Getter

keysAreEnabled

Description:
  • Getter

Source:

Getter

(protected) keysAreEnabled_ :boolean

Description:
  • Indicates whether the keyboard (WASD and arrow keys) is also used.

Source:

Indicates whether the keyboard (WASD and arrow keys) is also used.

Type:
  • boolean

mouseIsEnabled

Description:
  • Getter

Source:

Getter

(protected) mouseIsEnabled_ :boolean

Description:
  • Specifies whether mouse events should be captured.

Source:

Specifies whether mouse events should be captured.

Type:
  • boolean

states

Description:
  • Getter

Source:

Getter

(protected) states_ :Map.<string, boolean>

Description:
Source:

List of MoveType activation states

Type:
  • Map.<string, boolean>

(protected) target_ :Element

Description:
  • Element on which the event listeners are applied.

Source:

Element on which the event listeners are applied.

Type:
  • Element

touchMoveTolerance :Coordinate|Object

Description:
  • Tolerance values to treat a touch move as a motion.

Source:

Tolerance values to treat a touch move as a motion.

Type:
  • Coordinate | Object

touchStartMoveDistance

Description:
  • Getter

Source:

Getter

(private) touchStartMoveDistance_ :Coordinate

Description:
  • Value of the distance of the current interaction point to the start interaction point.

Source:

Value of the distance of the current interaction point to the start interaction point.

Type:
  • Coordinate

velocity :Vec3|Object

Description:
  • Motion velocity value.

Source:

Motion velocity value.

Type:
  • Vec3 | Object

(protected) zoomTimeout_ :number

Description:
  • Timeout instance for delayed zoom state changes.

Source:

Timeout instance for delayed zoom state changes.

Type:
  • number

zoomingIsEnabled

Description:
  • Getter

Source:

Getter

(protected) zoomingIsEnabled_ :boolean

Description:
  • Indicates whether zooming (scroll wheel and 2 finger pinch) is enabled.

Source:

Indicates whether zooming (scroll wheel and 2 finger pinch) is enabled.

Type:
  • boolean

Methods

activate(targetnon-null, disableKeysopt, disableZoomingopt, disableMouseopt, enableGamepadopt)

Description:
  • Method activates the listener and thus the monitoring of user interaction with the application.

Source:
Parameters:
Name Type Attributes Default Description
target Element

Element on which the event listeners are applied.

disableKeys boolean <optional>
false

Indicates whether the keyboard (WASD and arrow keys) is also used.

disableZooming boolean <optional>
false

Indicates whether zooming (scroll wheel and 2 finger pinch) is enabled.

disableMouse boolean <optional>
false

Specifies whether mouse events should be captured.

enableGamepad boolean <optional>
false

Specifies whether it should be monitored that a gamepad can also be used.

checkGamepad(gamepadopt, idCondition) → {boolean}

Description:
  • Method checks if a gamepad is available and should be used.

Source:
Parameters:
Name Type Attributes Default Description
gamepad Gamepad <optional>
idCondition string | null null
Returns:
Type
boolean

deactivate()

Description:
  • Method deactivates the listener. It will stop the monitoring of user interaction with the application.

Source:

getAcceleration(axisOrZoomopt) → {number}

Description:
  • Gets an acceleration value by an optional list key.

Source:
Parameters:
Name Type Attributes Description
axisOrZoom string <optional>
Returns:
Type
number

getFriction(axisOrZoom) → {number}

Description:
  • Gets a friction value by an optional list key.

Source:
Parameters:
Name Type Description
axisOrZoom string
Returns:
Type
number

getGamepad(idCondition) → {Gamepad}

Description:
  • Get the gamepag instance

Source:
Parameters:
Name Type Description
idCondition string | null
Returns:
Type
Gamepad

(protected) handleKeyDown_(event)

Description:
  • Method monitors the document keyboard key down event.

Source:
Parameters:
Name Type Description
event KeyEvent

(protected) handleKeyUp_(event)

Description:
  • Method monitors the document keyboard key up event.

Source:
Parameters:
Name Type Description
event KeyEvent

(protected) handleUserDown_(event)

Description:
  • Method monitors the target (pointer|mouse|touch) down event.

Source:
Parameters:
Name Type Description
event Event

(protected) handleUserFocusIn_()

Description:
  • Method monitors the window focus in event.

Source:

(protected) handleUserFocusOut_()

Description:
  • Method monitors the window focus out event.

Source:

(protected) handleUserMove_(event)

Description:
  • Method monitors the target (pointer|mouse|touch) move event.

Source:
Parameters:
Name Type Description
event Event

(private) handleUserScroll_(event)

Description:
  • Method monitors the window scroll wheel event.

Source:
Parameters:
Name Type Description
event Event

(protected) handleUserUp_(event)

Description:
  • Method monitors the target (pointer|mouse|touch) up event.

Source:
Parameters:
Name Type Description
event Event

(private) hasGamepadButtonPressed_(button) → {boolean}

Description:
  • Method monitors the gamepad button press event.

Source:
Parameters:
Name Type Description
button Object | number
Returns:
Type
boolean

setAcceleration(value, axisOrZoomopt)

Description:
  • Sets/saves an acceleration value by an optional list key.

Source:
Parameters:
Name Type Attributes Description
value number
axisOrZoom string <optional>

setFriction(value, axisOrZoomopt)

Description:
  • Sets/saves a friction value by an optional list key.

Source:
Parameters:
Name Type Attributes Description
value number
axisOrZoom string <optional>

stopInteraction()

Description:
  • Will Stop only the current interaction monitoring

Source: