From d5dea3b277e9355a8278a5392a871b2c2b8826d1 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 21:22:55 +0000 Subject: [PATCH] Changes Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com> --- src/pages/XRSession.tsx | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/pages/XRSession.tsx b/src/pages/XRSession.tsx index 85615f6..0803f8e 100644 --- a/src/pages/XRSession.tsx +++ b/src/pages/XRSession.tsx @@ -29,19 +29,37 @@ if (navigator.xr) { }); } +// Lê flags de feature WebXR do localStorage (default: todas ON). +// O usuário liga/desliga pelo HUD AR (aba WebXR) para diagnosticar qual +// feature ativa o grid de segurança do Quest. Mudanças exigem sair e re-entrar do AR. +function loadXRFeatures() { + const defaults = { + handTracking: true, planeDetection: true, hitTest: true, domOverlay: true, + anchors: true, meshDetection: true, depthSensing: true, layers: true, + bodyTracking: true, lightEstimation: true, + }; + try { + const raw = localStorage.getItem('xrFeatures'); + if (raw) return { ...defaults, ...JSON.parse(raw) }; + } catch {} + return defaults; +} +const _xrf = loadXRFeatures(); +console.log('[XR] Features:', _xrf); + const store = createXRStore({ hand: { left: true, right: true }, controller: { left: true, right: true }, - // Audit de features WebXR — pedimos só o que o app usa, para reduzir - // gatilhos do Space Sense / Guardian do Quest (grid vermelho/azul perto - // de paredes e objetos). Mantemos hit-test, plane-detection e hand-tracking; - // desligamos anchors, mesh-detection, depth-sensing e layers que não usamos. - anchors: false, - meshDetection: false, - depthSensing: false, - layers: false, - bodyTracking: false, - // handTracking, planeDetection, hitTest, domOverlay ficam no default (true) + handTracking: _xrf.handTracking, + planeDetection: _xrf.planeDetection, + hitTest: _xrf.hitTest, + domOverlay: _xrf.domOverlay, + anchors: _xrf.anchors, + meshDetection: _xrf.meshDetection, + depthSensing: _xrf.depthSensing, + layers: _xrf.layers, + bodyTracking: _xrf.bodyTracking, + lightEstimation: _xrf.lightEstimation, }); // ─── XRModel ───────────────────────────────────────────