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({
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 ───────────────────────────────────────────