Class: PointerLockControls
controls/pointerLock.PointerLockControls
Hierarchy
โณ
PointerLockControls
Constructors
constructor
โข new PointerLockControls(element
, camera
, object?
, sensitivity?
)
Creates a PointerLockControls instance and sets up it's event handlers.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
element | HTMLElement | undefined | The element to use when handling control events |
camera | Camera | undefined | The camera to control |
object? | Object2D | undefined | An optional object to follow the camera's yaw |
sensitivity | number | 0.1 | Movement sensitivity |
Overrides
Defined in
src/controls/pointerLock.ts:17
Properties
camera
โข camera: Camera
Inherited from
Defined in
src/controls/controls.ts:14
element
โข element: HTMLElement
Inherited from
Defined in
src/controls/controls.ts:8
isLocked
โข isLocked: boolean
= false
Defined in
src/controls/pointerLock.ts:7
movementX
โข movementX: number
= 0
Inherited from
Defined in
src/controls/controls.ts:10
movementY
โข movementY: number
= 0
Inherited from
Defined in
src/controls/controls.ts:11
object
โข object: Object2D
Inherited from
Defined in
src/controls/controls.ts:13
sensitivity
โข sensitivity: number
Inherited from
Defined in
src/controls/controls.ts:9
Methods
clickHandler
โธ Private
clickHandler(): void
Requests pointer lock if the control's are not already locked.
Returns
void
Defined in
src/controls/pointerLock.ts:28
dispose
โธ dispose(): void
Removes all events used for the controls and deals with any extra cleanup needed.
Returns
void
Overrides
Defined in
src/controls/pointerLock.ts:65
mouseMoveHandler
โธ Private
mouseMoveHandler(e
): void
Syncs this.movementX
and this.movementY
with the event's movement properties.
Parameters
Name | Type | Description |
---|---|---|
e | MouseEvent | The mouse event |
Returns
void
Defined in
src/controls/pointerLock.ts:49
pointerLockChangeHandler
โธ Private
pointerLockChangeHandler(): void
Resets movementX
and movementY
if the controls has been unlocked.
Returns
void
Defined in
src/controls/pointerLock.ts:35
update
โธ update(): void
Calculates the new camera direction from movementX
and movementY
.
Called every tick.
Returns
void
Overrides
Defined in
src/controls/pointerLock.ts:61