Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-05-18 21:22:55 +00:00
parent d73611734a
commit d5dea3b277
+28 -10
View File
@@ -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({ const store = createXRStore({
hand: { left: true, right: true }, hand: { left: true, right: true },
controller: { left: true, right: true }, controller: { left: true, right: true },
// Audit de features WebXR — pedimos só o que o app usa, para reduzir handTracking: _xrf.handTracking,
// gatilhos do Space Sense / Guardian do Quest (grid vermelho/azul perto planeDetection: _xrf.planeDetection,
// de paredes e objetos). Mantemos hit-test, plane-detection e hand-tracking; hitTest: _xrf.hitTest,
// desligamos anchors, mesh-detection, depth-sensing e layers que não usamos. domOverlay: _xrf.domOverlay,
anchors: false, anchors: _xrf.anchors,
meshDetection: false, meshDetection: _xrf.meshDetection,
depthSensing: false, depthSensing: _xrf.depthSensing,
layers: false, layers: _xrf.layers,
bodyTracking: false, bodyTracking: _xrf.bodyTracking,
// handTracking, planeDetection, hitTest, domOverlay ficam no default (true) lightEstimation: _xrf.lightEstimation,
}); });
// ─── XRModel ─────────────────────────────────────────── // ─── XRModel ───────────────────────────────────────────