🚀 Auto-deploy: melhoria no snap e medição AR em 21/07/2026 10:39:07

This commit is contained in:
2026-07-21 10:39:07 +00:00
parent e6737c9e07
commit 245cfd4b2f
+5 -4
View File
@@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { Canvas, useFrame } from "@react-three/fiber"; import { Canvas, useFrame, ThreeEvent } from "@react-three/fiber";
import { import {
OrbitControls, OrbitControls,
Grid, Grid,
@@ -169,7 +169,7 @@ const Table = ({
onSurfaceClick: (p: THREE.Vector3, n: THREE.Vector3) => void; onSurfaceClick: (p: THREE.Vector3, n: THREE.Vector3) => void;
onEdgeClick: (p: THREE.Vector3, n: THREE.Vector3) => void; onEdgeClick: (p: THREE.Vector3, n: THREE.Vector3) => void;
}) => { }) => {
const handleClick = (e: any) => { const handleClick = (e: ThreeEvent<MouseEvent>) => {
e.stopPropagation(); e.stopPropagation();
if (!e.intersections[0].face) return; if (!e.intersections[0].face) return;
const n = e.intersections[0].face.normal; const n = e.intersections[0].face.normal;
@@ -241,7 +241,7 @@ const QuestCubeLab = () => {
const [xrSupported] = useState(() => const [xrSupported] = useState(() =>
typeof navigator !== "undefined" && typeof navigator !== "undefined" &&
"xr" in navigator && "xr" in navigator &&
typeof (navigator as any).xr?.isSessionSupported === "function" typeof (navigator as Navigator & { xr?: { isSessionSupported?: Function } }).xr?.isSessionSupported === "function"
); );
const posRef = useRef(cubePos); const posRef = useRef(cubePos);
@@ -276,7 +276,8 @@ const QuestCubeLab = () => {
const enterXR = async () => { const enterXR = async () => {
try { try {
const xr = (navigator as any).xr; const xr = (navigator as Navigator & { xr?: { requestSession: (mode: string) => Promise<unknown> } })?.xr;
if (!xr) return;
const session = await xr.requestSession("immersive-ar"); const session = await xr.requestSession("immersive-ar");
void session; void session;
alert("XR session requisitada."); alert("XR session requisitada.");