🚀 Auto-deploy: melhoria no snap e medição AR em 21/07/2026 10:39:07
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Canvas, useFrame } from "@react-three/fiber";
|
||||
import { Canvas, useFrame, ThreeEvent } from "@react-three/fiber";
|
||||
import {
|
||||
OrbitControls,
|
||||
Grid,
|
||||
@@ -169,7 +169,7 @@ const Table = ({
|
||||
onSurfaceClick: (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();
|
||||
if (!e.intersections[0].face) return;
|
||||
const n = e.intersections[0].face.normal;
|
||||
@@ -241,7 +241,7 @@ const QuestCubeLab = () => {
|
||||
const [xrSupported] = useState(() =>
|
||||
typeof navigator !== "undefined" &&
|
||||
"xr" in navigator &&
|
||||
typeof (navigator as any).xr?.isSessionSupported === "function"
|
||||
typeof (navigator as Navigator & { xr?: { isSessionSupported?: Function } }).xr?.isSessionSupported === "function"
|
||||
);
|
||||
|
||||
const posRef = useRef(cubePos);
|
||||
@@ -276,7 +276,8 @@ const QuestCubeLab = () => {
|
||||
|
||||
const enterXR = async () => {
|
||||
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");
|
||||
void session;
|
||||
alert("XR session requisitada.");
|
||||
|
||||
Reference in New Issue
Block a user