Skip to content

Commit 78a0f7e

Browse files
james090500Mugen87
andauthored
PointerLockControls: Add unadjustedMovementoption to lock(). (#30687)
* Add unadjustedMovement option to PointerLockControls * Update PointerLockControls.js Clean up. * Update PointerLockControls.js Fix docs. * Update PointerLockControls.js Improve description. --------- Co-authored-by: Michael Herzog <[email protected]>
1 parent 88c358b commit 78a0f7e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/jsm/controls/PointerLockControls.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,15 @@ class PointerLockControls extends Controls {
198198

199199
/**
200200
* Activates the pointer lock.
201+
*
202+
* @param {boolean} [unadjustedMovement=false] - Disables OS-level adjustment for mouse acceleration, and accesses raw mouse input instead.
203+
* Setting it to true will disable mouse acceleration.
201204
*/
202-
lock() {
205+
lock( unadjustedMovement = false ) {
203206

204-
this.domElement.requestPointerLock();
207+
this.domElement.requestPointerLock( {
208+
unadjustedMovement
209+
} );
205210

206211
}
207212

0 commit comments

Comments
 (0)