diff --git a/src/components/three/XRControllerMeasure.tsx b/src/components/three/XRControllerMeasure.tsx index 5c87a20..41d1bcd 100644 --- a/src/components/three/XRControllerMeasure.tsx +++ b/src/components/three/XRControllerMeasure.tsx @@ -82,7 +82,7 @@ export function XRControllerMeasure() { // running them every frame at 72fps can stall the Quest right after // toggling "Medir" from the Ferramentas tab. We cap heavy work to ~24Hz. // Trigger/A/B/L-trigger polling continues every frame for responsiveness. - const hitTestSourceRef = useRef(null); + const hitTestSourceRef = useRef(null); const hitTestRequestedRef = useRef(false); useFrame((_state, _dt, frame: XRFrame | undefined) => { diff --git a/src/pages/XRSession.tsx b/src/pages/XRSession.tsx index 30d51e5..f68457a 100644 --- a/src/pages/XRSession.tsx +++ b/src/pages/XRSession.tsx @@ -448,7 +448,7 @@ function XRGridLandingHandler() { {/* Retícula dourada premium */} - + @@ -557,7 +557,7 @@ function XRVirtRealCalibHandler() { {/* Golden reticle */} - + @@ -920,6 +920,11 @@ function XRSnapHandler() { // ─── Desktop Aligner Fallback for Virt/Real Calibration ─ function XRVirtRealDesktopAligner() { const { gl, camera, scene } = useThree(); + const [tick, setTick] = useState(0); + + useEffect(() => { + return subscribeXRCalibration(() => setTick(t => t + 1)); + }, []); useEffect(() => { const isAligning = xrCalibration.alignType === 'virt-real' && @@ -959,7 +964,7 @@ function XRVirtRealDesktopAligner() { gl.domElement.addEventListener('click', onClick); return () => gl.domElement.removeEventListener('click', onClick); - }, [gl, camera, scene, xrCalibration.step, xrCalibration.alignType]); + }, [gl, camera, scene, tick]); return null; }