aframevr / aframevr/aframe

Pointerlock erratic camera movements

Open
#5,177 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
17.6k
Forks
4.4k
PR merge metrics
No merged PRs in 30d

Description

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}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the look-controls.js component and reproduce the pointerlock camera movement on Windows with a Chromium-based browser and a mouse polling above 250Hz. Compare movementX and movementY handling with the reported workaround. Done means outlier movement values no longer cause jumpy camera movement while normal pointerlock camera movement remains functional.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
ar-vr-xr
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.