Skip to main content

Class: Controls

controls/controls.Controls

Stores common properties and methods for controls.

Hierarchy

Constructors

constructor

โ€ข new Controls(element, camera, object?, sensitivity?)

Creates a Controls instance.

Parameters

NameTypeDefault valueDescription
elementHTMLElementundefinedThe element to use when handling control events
cameraCameraundefined-
object?Object2DundefinedAn optional object to follow the camera's yaw
sensitivitynumber0.1Movement sensitivity

Defined in

src/controls/controls.ts:23

Properties

camera

โ€ข camera: Camera

Defined in

src/controls/controls.ts:14


element

โ€ข element: HTMLElement

Defined in

src/controls/controls.ts:8


movementX

โ€ข movementX: number = 0

Defined in

src/controls/controls.ts:10


movementY

โ€ข movementY: number = 0

Defined in

src/controls/controls.ts:11


object

โ€ข object: Object2D

Defined in

src/controls/controls.ts:13


sensitivity

โ€ข sensitivity: number

Defined in

src/controls/controls.ts:9

Methods

dispose

โ–ธ Abstract dispose(): void

Removes all events used for the controls and deals with any extra cleanup needed.

Returns

void

Defined in

src/controls/controls.ts:38


update

โ–ธ Abstract update(): void

Called every tick.

Returns

void

Defined in

src/controls/controls.ts:33