Skip to content

Conversation

@vincentfretin
Copy link
Contributor

Description:

Testing on https://aframe-xr-starterkit.glitch.me/ AR mode where we had the shadow of the piano in A-Frame 1.5.0
with a message at the bottom "Scanning environment, finding surface."
It doesn't work since A-Frame 1.6.0 because of commit 77af389 that changed the order of setting the ar-mode state so that particular check in the ar-hit-test component

this.el.sceneEl.renderer.xr.addEventListener('sessionstart', function () {
// Don't request Hit Test unless AR (breaks WebXR Emulator)
if (!this.el.is('ar-mode')) { return; }

broke because ar-mode state is not set at the time this sessionstart listener is called.

Changes proposed:

The fix is here to change
this.el.sceneEl.renderer.xr.addEventListener('sessionstart'
to
this.el.addEventListener('enter-vr'
similar to what we do in the reflection or hide-on-enter-ar components.

…ore checking for it, this fix ar-hit-test component that was broken since 1.6.0 that changed some order in aframevr@77af389
@dmarcos
Copy link
Member

dmarcos commented Mar 3, 2025

Thanks!

@dmarcos dmarcos merged commit 53c5ca0 into aframevr:master Mar 3, 2025
3 checks passed
@vincentfretin vincentfretin deleted the fix-ar-hit-test branch March 4, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants