lvjincheng 4 лет назад
Родитель
Сommit
4747cefa5e
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      Assets/BowArrow/Scripts/Bluetooth/ShootCheck.cs

+ 8 - 0
Assets/BowArrow/Scripts/Bluetooth/ShootCheck.cs

@@ -181,6 +181,14 @@ public class ShootCheck : MonoBehaviour
             {
                 maxAcc = acc;
             }
+            if (acc > 15.9f) {
+                double p1 = -1.188748333;
+                double p2 = 0.033890372;
+                double p3 = 3.408473747;
+                float x = (keyAccList.Count + 1) * 2; //单位毫秒
+                double y = 1.0 / (p1+p2*Mathf.Pow(x, 0.5f)*Mathf.Log(x)+p3/Mathf.Pow(x, 0.5f));
+                acc = (float) y;
+            }
             keyAccList.Enqueue(acc);
             keyTimeList.Enqueue(t);
             return false;