🚀 Auto-deploy: melhoria no snap e medição AR em 11/06/2026 14:07:02
This commit is contained in:
@@ -313,6 +313,10 @@ function GLBModel({ sceneModel, isActive }: { sceneModel: SceneModel; isActive:
|
|||||||
const scaleRatio = useModelStore((st) => st.scaleRatio);
|
const scaleRatio = useModelStore((st) => st.scaleRatio);
|
||||||
const renderFactor = scaleRatio?.factor ?? 1;
|
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
|
// Calibration quaternion (applied innermost, around center). We render with identity
|
||||||
// while calibration is in progress for this model so face normals reflect the
|
// while calibration is in progress for this model so face normals reflect the
|
||||||
// un-calibrated frame; the result is committed at the end.
|
// 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 */}
|
{/* Rotation + scale around the geometry center */}
|
||||||
<group
|
<group
|
||||||
ref={ref}
|
ref={ref}
|
||||||
rotation={[rotXRad, rotYRad, rotZRad]}
|
rotation={rotationEuler}
|
||||||
scale={[s, s, s]}
|
scale={[s, s, s]}
|
||||||
>
|
>
|
||||||
{/* Calibration rotation (innermost, around center). */}
|
{/* Calibration rotation (innermost, around center). */}
|
||||||
|
|||||||
@@ -128,13 +128,14 @@ export function XRGrabbable({ allowScale = true, lockedActive = false, onGrabSta
|
|||||||
group.scale.set(1, 1, 1);
|
group.scale.set(1, 1, 1);
|
||||||
|
|
||||||
// Save to store
|
// Save to store
|
||||||
|
const euler = new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ');
|
||||||
state.setFineTuning({
|
state.setFineTuning({
|
||||||
posX: finalPos.x / renderFactor,
|
posX: finalPos.x / renderFactor,
|
||||||
posY: finalPos.y / renderFactor,
|
posY: finalPos.y / renderFactor,
|
||||||
posZ: finalPos.z / renderFactor,
|
posZ: finalPos.z / renderFactor,
|
||||||
rotX: (new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ').x * 180) / Math.PI,
|
rotX: (euler.x * 180) / Math.PI,
|
||||||
rotY: (new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ').y * 180) / Math.PI,
|
rotY: (euler.y * 180) / Math.PI,
|
||||||
rotZ: (new THREE.Euler().setFromQuaternion(finalQuat, 'YXZ').z * 180) / Math.PI,
|
rotZ: (euler.z * 180) / Math.PI,
|
||||||
scale: finalScale.x / renderFactor,
|
scale: finalScale.x / renderFactor,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -365,7 +365,7 @@ const Index = () => {
|
|||||||
|
|
||||||
{/* Footer */}
|
{/* Footer */}
|
||||||
<p className="mt-16 text-center font-mono text-xs text-muted-foreground/50">
|
<p className="mt-16 text-center font-mono text-xs text-muted-foreground/50">
|
||||||
SteelXR v1.12 — Q.C. Inspection
|
SteelXR v1.13 — Q.C. Inspection
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{showLogs && (
|
{showLogs && (
|
||||||
|
|||||||
@@ -190,6 +190,10 @@ function XRModel({ sceneModel }: { sceneModel: import('@/stores/useModelStore').
|
|||||||
const scaleRatio = useModelStore((st) => st.scaleRatio);
|
const scaleRatio = useModelStore((st) => st.scaleRatio);
|
||||||
const renderFactor = scaleRatio?.factor ?? 1;
|
const renderFactor = scaleRatio?.factor ?? 1;
|
||||||
|
|
||||||
|
const rotationEuler = useMemo(() => {
|
||||||
|
return new THREE.Euler(rotXRad, rotYRad, rotZRad, 'YXZ');
|
||||||
|
}, [rotXRad, rotYRad, rotZRad]);
|
||||||
|
|
||||||
const calQuatArr = sceneModel.calibrationQuat;
|
const calQuatArr = sceneModel.calibrationQuat;
|
||||||
const isCalibratingThis = xrCalibration.modelId === sceneModel.id && xrCalibration.step !== 'idle' && xrCalibration.step !== 'done';
|
const isCalibratingThis = xrCalibration.modelId === sceneModel.id && xrCalibration.step !== 'idle' && xrCalibration.step !== 'done';
|
||||||
const calQuat = useMemo(() => {
|
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 e escala em volta do centro geométrico */}
|
||||||
<group
|
<group
|
||||||
ref={ref}
|
ref={ref}
|
||||||
rotation={[rotXRad, rotYRad, rotZRad]}
|
rotation={rotationEuler}
|
||||||
scale={[s, s, s]}
|
scale={[s, s, s]}
|
||||||
>
|
>
|
||||||
{/* Rotação de calibração */}
|
{/* Rotação de calibração */}
|
||||||
|
|||||||
Reference in New Issue
Block a user