aframe icon indicating copy to clipboard operation
aframe copied to clipboard

Pointerlock erratic camera movements

Open kkota1 opened this issue 2 years ago • 2 comments

High polling rate (>250Hz) mouse = jumpy camera movements with some platforms

  • A-Frame Version: all
  • Platform / Device: Windows + chromium-based browser
  • Reproducible Code Snippet or URL:

Root cause is an OS bug: https://bugs.chromium.org/p/chromium/issues/detail?id=781182

Workaround we successfully implemented in our fork involves checking for outlier values in look-controls.js component

    let x = evt.movementX || evt.mozMovementX || 0;
    if (Math.abs(x) > window.innerWidth/3) {x = 0}

    let y = evt.movementY || evt.mozMovementY || 0;
    if (Math.abs(y) > window.innerHeight/3) {y = 0}

kkota1 avatar Dec 02 '22 20:12 kkota1