Skip to content

Commit

Permalink
PointerLockControls: remove "moz", "webkit" prefixes for "MouseEvent.…
Browse files Browse the repository at this point in the history
…movementX" (#385)
  • Loading branch information
satelllte authored Nov 12, 2024
1 parent 344c894 commit 6b51b6d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/controls/PointerLockControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ class PointerLockControls extends EventDispatcher {

private onMouseMove = (event: MouseEvent): void => {
if (!this.domElement || this.isLocked === false) return
const movementX = event.movementX || (event as any).mozMovementX || (event as any).webkitMovementX || 0
const movementY = event.movementY || (event as any).mozMovementY || (event as any).webkitMovementY || 0
_euler.setFromQuaternion(this.camera.quaternion)
_euler.y -= movementX * 0.002 * this.pointerSpeed
_euler.x -= movementY * 0.002 * this.pointerSpeed
_euler.y -= event.movementX * 0.002 * this.pointerSpeed
_euler.x -= event.movementY * 0.002 * this.pointerSpeed
_euler.x = Math.max(_PI_2 - this.maxPolarAngle, Math.min(_PI_2 - this.minPolarAngle, _euler.x))
this.camera.quaternion.setFromEuler(_euler)
// @ts-ignore
Expand Down

0 comments on commit 6b51b6d

Please sign in to comment.