Skip to content

Raycaster component fails to follow camera in immersive mode (mobile) #4521

@NNskelly

Description

@NNskelly

Description:

Likely tangential to #4412 which is in turn tied to underlying THREE issue mrdoob/three.js#18448

On Android mobile chrome, in immersive WebXR mode (AR or VR), 'raycaster' components on the a-camera cease follow the camera.

In the linked demo,
Expected behavior:

  • Outside of immersive mode, can look around with tilt/mouse/keyboard controls; reticle tracks along groundplane
  • In immersive mode, can look around with tilt/tracked control; reticle tracks along groundplane

Observed behavior:

  • Outside of immersive mode, on Android Chrome 80 (WebXR AR not yet available), can look around with tilt controls; reticle tracks accordingly. On desktop, can look around with mouse controls; reticle tracks accordingly. On AR-enabled Chrome 82 (canary) on Android, camera view rotation appears to twitch with device rotation and track on 1 axis with touch, but is otherwise fixed directly downwards.
  • In VR immersive mode on chrome 80, and in VR or AR immersive mode on chrome 82, can look around, but reticle resets and stays stuck on or about the scene origin; hit tests no longer return the point the camera is looking at. Rotation of reticle still updates, so the data is accurate in the camera's rotation matrix, the A-Frame raycaster simply is not sourcing it effectively.

Short of diving into the A-Frame raycaster component source, I would guess it's using something akin to Object3D.getWorldDirection() for its ray generation, which would mean it will be broken due to the getWorld* immersive-mode THREE breakage until and unless it is rewritten to e.g. transform a ray independently through the available and demonstrably correct raw transform matrices.

Chrome 80, AR unavailable, expected behavior outside immersive mode
Screenshot_20200310-104856_Chrome

Chrome 82, AR available, stuck view outside immersive mode
Screenshot_20200310-104905_Chrome Canary

Chrome 82, in AR immersive mode, hit test result stuck at origin
Screenshot_20200310-105018_Chrome Canary
Screenshot_20200310-105021_Chrome Canary

Chrome 82 in VR immersive mode; essentially identical to Chrome 80 in VR immersive mode, hit test result equally stuck at origin.
Screenshot_20200310-105042_Chrome Canary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions