From fc10c77346a30486a232064cfba7f3c6fa276fd2 Mon Sep 17 00:00:00 2001 From: admtracksteel Date: Thu, 11 Jun 2026 14:07:02 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Auto-deploy:=20melhoria=20no=20s?= =?UTF-8?q?nap=20e=20medi=C3=A7=C3=A3o=20AR=20em=2011/06/2026=2014:07:02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/three/ModelViewer.tsx | 6 +++++- src/components/three/XRGrabbable.tsx | 7 ++++--- src/pages/Index.tsx | 2 +- src/pages/XRSession.tsx | 6 +++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/three/ModelViewer.tsx b/src/components/three/ModelViewer.tsx index 3774e8d..e1fbb1a 100644 --- a/src/components/three/ModelViewer.tsx +++ b/src/components/three/ModelViewer.tsx @@ -313,6 +313,10 @@ function GLBModel({ sceneModel, isActive }: { sceneModel: SceneModel; isActive: const scaleRatio = useModelStore((st) => st.scaleRatio); const renderFactor = scaleRatio?.factor ?? 1; + const rotationEuler = useMemo(() => { + return new THREE.Euler(rotXRad, rotYRad, rotZRad, 'YXZ'); + }, [rotXRad, rotYRad, rotZRad]); + // Calibration quaternion (applied innermost, around center). We render with identity // while calibration is in progress for this model so face normals reflect the // un-calibrated frame; the result is committed at the end. @@ -382,7 +386,7 @@ function GLBModel({ sceneModel, isActive }: { sceneModel: SceneModel; isActive: {/* Rotation + scale around the geometry center */} {/* Calibration rotation (innermost, around center). */} diff --git a/src/components/three/XRGrabbable.tsx b/src/components/three/XRGrabbable.tsx index e3c5fd2..8aff615 100644 --- a/src/components/three/XRGrabbable.tsx +++ b/src/components/three/XRGrabbable.tsx @@ -128,13 +128,14 @@ export function XRGrabbable({ allowScale = true, lockedActive = false, onGrabSta group.scale.set(1, 1, 1); // Save to store + const euler = new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ'); state.setFineTuning({ posX: finalPos.x / renderFactor, posY: finalPos.y / renderFactor, posZ: finalPos.z / renderFactor, - rotX: (new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ').x * 180) / Math.PI, - rotY: (new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ').y * 180) / Math.PI, - rotZ: (new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ').z * 180) / Math.PI, + rotX: (euler.x * 180) / Math.PI, + rotY: (euler.y * 180) / Math.PI, + rotZ: (euler.z * 180) / Math.PI, scale: finalScale.x / renderFactor, }); }; diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index 5b1a841..3ede712 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -365,7 +365,7 @@ const Index = () => { {/* Footer */}

- SteelXR v1.12 — Q.C. Inspection + SteelXR v1.13 — Q.C. Inspection

{showLogs && ( diff --git a/src/pages/XRSession.tsx b/src/pages/XRSession.tsx index 6c17323..e97185c 100644 --- a/src/pages/XRSession.tsx +++ b/src/pages/XRSession.tsx @@ -190,6 +190,10 @@ function XRModel({ sceneModel }: { sceneModel: import('@/stores/useModelStore'). const scaleRatio = useModelStore((st) => st.scaleRatio); const renderFactor = scaleRatio?.factor ?? 1; + const rotationEuler = useMemo(() => { + return new THREE.Euler(rotXRad, rotYRad, rotZRad, 'YXZ'); + }, [rotXRad, rotYRad, rotZRad]); + const calQuatArr = sceneModel.calibrationQuat; const isCalibratingThis = xrCalibration.modelId === sceneModel.id && xrCalibration.step !== 'idle' && xrCalibration.step !== 'done'; const calQuat = useMemo(() => { @@ -292,7 +296,7 @@ function XRModel({ sceneModel }: { sceneModel: import('@/stores/useModelStore'). {/* Rotação e escala em volta do centro geométrico */} {/* Rotação de calibração */}