lvjincheng 3 лет назад
Родитель
Сommit
953837745c

+ 3 - 0
Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

@@ -322,6 +322,9 @@ public class AimHandler : MonoBehaviour
         msOld = ms;
 
         AMesh.transform.localRotation = newRotation = _9Axis.update(Acc * 10, Gyr, Mag, TimeGap);
+
+        if (BowQuatDebug.ins) BowQuatDebug.ins.ShowModuleQuat(newRotation.eulerAngles);
+
         if (SB_EventSystem.ins && SB_EventSystem.ins.simulateMouseIsAwaked) {
             SB_EventSystem.ins.MoveSimulateMouse(newRotation);
         }

+ 7 - 0
Assets/BowArrow/Scripts/Debug/BowQuatDebug/BowQuatDebug.cs

@@ -18,6 +18,13 @@ public class BowQuatDebug : MonoBehaviour
         if (ins == this) ins = null;
     }
 
+    public void ShowModuleQuat(Vector3 angles) {
+        string ax = angles.x.ToString("#0.000");
+        string ay = angles.y.ToString("#0.000");
+        string az = angles.z.ToString("#0.000");
+        text.text = $"模块欧拉角\nX: {ax} \nY: {ay} \nZ: {az}";
+    }
+
     public void ShowRealBowQuat(Vector3 angles) {
         string rx = (angles.x > 180 ? 360f - angles.x : -angles.x).ToString("#0.000");
         string ry = (angles.y > 180 ? angles.y - 360f : angles.y).ToString("#0.000");

+ 2 - 2
Assets/BowArrow/Scripts/Game/BowCamera.cs

@@ -122,7 +122,7 @@ public class BowCamera : MonoBehaviour
             needLookAtPoint = false;
             //镜头看向九轴姿态虚拟节点
             this.transform.LookAt(CameraToLook.ins.point);
-            if (BowQuatDebug.ins) BowQuatDebug.ins.ShowRealBowQuat(this.transform.localEulerAngles); 
+            // if (BowQuatDebug.ins) BowQuatDebug.ins.ShowRealBowQuat(this.transform.localEulerAngles); 
             if (!CommonConfig.isReleaseVersion) {
                 //镜头旋转比值转换
                 Vector3 localAngles = this.transform.localEulerAngles;
@@ -134,7 +134,7 @@ public class BowCamera : MonoBehaviour
                     localAngles = bowCameraFixed.LimitBowAngle(localAngles);
                 }
                 this.transform.localEulerAngles = localAngles;
-                if (BowQuatDebug.ins) BowQuatDebug.ins.ShowGameBowQuat(this.transform.localEulerAngles);
+                // if (BowQuatDebug.ins) BowQuatDebug.ins.ShowGameBowQuat(this.transform.localEulerAngles);
             }
         }
         onAfterLateUpdate?.Invoke();