From 728ebc1e9d4593713207eccd8c8b19ec0b4a25e8 Mon Sep 17 00:00:00 2001 From: satelllte <20585619+satelllte@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:47:46 +0200 Subject: [PATCH] PointerLockControls: remove browser prefixes for "MouseEvent.movement" (#29802) --- examples/jsm/controls/PointerLockControls.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/jsm/controls/PointerLockControls.js b/examples/jsm/controls/PointerLockControls.js index 184c43f60cbf4d..161eac1a3c7b4d 100644 --- a/examples/jsm/controls/PointerLockControls.js +++ b/examples/jsm/controls/PointerLockControls.js @@ -127,14 +127,11 @@ function onMouseMove( event ) { if ( this.enabled === false || this.isLocked === false ) return; - const movementX = event.movementX || event.mozMovementX || event.webkitMovementX || 0; - const movementY = event.movementY || event.mozMovementY || event.webkitMovementY || 0; - const camera = this.object; _euler.setFromQuaternion( 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 ) );