From 9efa735d68a8385a73290156b73850f7233e05fe Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 08 五月 2024 10:27:24 +0800
Subject: [PATCH] #

---
 src/components/agv.jsx |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/components/agv.jsx b/src/components/agv.jsx
index c96cf8c..4588a9d 100644
--- a/src/components/agv.jsx
+++ b/src/components/agv.jsx
@@ -14,7 +14,8 @@
 } from '../config/setting'
 
 const Agv = (props) => {
-    const { agvNo, position, theta, trayList, hasBox } = props;
+    const { agvNo, position, trayList, hasBox } = props;
+    const theta = -props.theta;
     const height = props.height * 0.04;
     const forkLength = props.forkLength * 0.1;
     const loaderTheta = Number(props.loaderTheta?.toFixed(1));
@@ -50,8 +51,8 @@
         }
 
         // group theta
-        if (groupTheta !== -theta && props.theta !== null) {
-            const minTheta = Common.minDiffTheta(groupTheta, -theta);
+        if (groupTheta !== theta && props.theta !== null) {
+            const minTheta = Common.normalizeAngle(theta);
             new TWEEN.Tween({ value: groupTheta })
                 .to({ value: minTheta }, INTERVAL_TIME)
                 .easing(TWEEN.Easing.Linear.None)
@@ -83,9 +84,10 @@
         // console.log("loaderTheta", loaderTheta);
         // console.log("loaderAbsoluteAngle", loaderAbsoluteAngle);
         if (integrateTheta !== loaderAbsoluteAngle && props.loaderTheta !== null) {
+            const minTheta = Common.normalizeAngle(loaderAbsoluteAngle);
             // const minTheta = Common.minDiffTheta(integrateTheta, loaderAbsoluteAngle);
             new TWEEN.Tween({ value: integrateTheta })
-                .to({ value: loaderAbsoluteAngle }, INTERVAL_TIME)
+                .to({ value: minTheta }, INTERVAL_TIME)
                 .easing(TWEEN.Easing.Linear.None)
                 .onUpdate((e) => {
                     setIntegrateTheta(e.value)

--
Gitblit v1.9.1