lvjincheng 3 anni fa
parent
commit
c99c91bcf7
43 ha cambiato i file con 1200 aggiunte e 39 eliminazioni
  1. 21 0
      Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs
  2. 44 29
      Assets/BowArrow/Scripts/Bluetooth/o09AxisCS.cs
  3. 124 0
      Assets/BowArrow/Scripts/Bluetooth/o0DistanceToAxis.cs
  4. 11 0
      Assets/BowArrow/Scripts/Bluetooth/o0DistanceToAxis.cs.meta
  5. 1 1
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/HTTPConnection.cs
  6. 2 2
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/HTTPManager.cs
  7. 2 2
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/HTTPRequest.cs
  8. 1 1
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs
  9. 1 1
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs
  10. 2 2
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs
  11. 1 1
      Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs
  12. 8 0
      Assets/Plugins/o0Lib.meta
  13. BIN
      Assets/Plugins/o0Lib/BouncyCastle.Crypto.dll
  14. 33 0
      Assets/Plugins/o0Lib/BouncyCastle.Crypto.dll.meta
  15. BIN
      Assets/Plugins/o0Lib/Fractions.dll
  16. 33 0
      Assets/Plugins/o0Lib/Fractions.dll.meta
  17. BIN
      Assets/Plugins/o0Lib/Mono.Data.Sqlite.dll
  18. 33 0
      Assets/Plugins/o0Lib/Mono.Data.Sqlite.dll.meta
  19. BIN
      Assets/Plugins/o0Lib/SixLabors.ImageSharp.dll
  20. 33 0
      Assets/Plugins/o0Lib/SixLabors.ImageSharp.dll.meta
  21. BIN
      Assets/Plugins/o0Lib/System.Buffers.dll
  22. 33 0
      Assets/Plugins/o0Lib/System.Buffers.dll.meta
  23. BIN
      Assets/Plugins/o0Lib/System.Memory.dll
  24. 33 0
      Assets/Plugins/o0Lib/System.Memory.dll.meta
  25. BIN
      Assets/Plugins/o0Lib/System.Numerics.Vectors.dll
  26. 33 0
      Assets/Plugins/o0Lib/System.Numerics.Vectors.dll.meta
  27. BIN
      Assets/Plugins/o0Lib/System.Reflection.Emit.ILGeneration.dll
  28. 33 0
      Assets/Plugins/o0Lib/System.Reflection.Emit.ILGeneration.dll.meta
  29. BIN
      Assets/Plugins/o0Lib/System.Reflection.Emit.Lightweight.dll
  30. 33 0
      Assets/Plugins/o0Lib/System.Reflection.Emit.Lightweight.dll.meta
  31. BIN
      Assets/Plugins/o0Lib/System.Runtime.CompilerServices.Unsafe.dll
  32. 33 0
      Assets/Plugins/o0Lib/System.Runtime.CompilerServices.Unsafe.dll.meta
  33. BIN
      Assets/Plugins/o0Lib/System.Text.Encoding.CodePages.dll
  34. 33 0
      Assets/Plugins/o0Lib/System.Text.Encoding.CodePages.dll.meta
  35. 263 0
      Assets/Plugins/o0Lib/o0NetLib.deps.json
  36. 7 0
      Assets/Plugins/o0Lib/o0NetLib.deps.json.meta
  37. BIN
      Assets/Plugins/o0Lib/o0NetLib.dll
  38. 33 0
      Assets/Plugins/o0Lib/o0NetLib.dll.meta
  39. BIN
      Assets/Plugins/o0Lib/o0NetLib.pdb
  40. 7 0
      Assets/Plugins/o0Lib/o0NetLib.pdb.meta
  41. BIN
      Assets/Plugins/o0Lib/zlib.net.dll
  42. 33 0
      Assets/Plugins/o0Lib/zlib.net.dll.meta
  43. 276 0
      代码备份/2022-8-9/o09AxisCS.cs

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

@@ -369,6 +369,15 @@ public class AimHandler : MonoBehaviour
         TimeGap = ms - msOld;
         msOld = ms;
 
+        GapMs = TimeGap;
+        gyr0o = UnityVectorTo0o(Gyr);
+        acc0o = UnityVectorTo0o(Acc);
+        mag0o = UnityVectorTo0o(Mag);
+        
+        distanceToAxis.Update(gyr0o, acc0o, mag0o, GapMs);
+        acc0o = distanceToAxis.AccCorrection(gyr0o, acc0o, GapMs);/**///轴心偏离矫正
+        Acc = o0VectorToUnity(acc0o);
+
         AMesh.transform.localRotation = newRotation = _9Axis.update(Acc * 10, Gyr, Mag, TimeGap);
 
         if (BowQuatDebug.ins) BowQuatDebug.ins.ShowModuleQuat(newRotation.eulerAngles);
@@ -378,6 +387,18 @@ public class AimHandler : MonoBehaviour
         }
     }
 
+    o0.Bow.DistanceToAxis distanceToAxis = new o0.Bow.DistanceToAxis();
+    double GapMs;
+    o0.Geometry.Vector<double> gyr0o;
+    o0.Geometry.Vector<double> acc0o;
+    o0.Geometry.Vector<double> mag0o;
+    o0.Geometry.Vector<double> UnityVectorTo0o(Vector3 src) {
+        return new o0.Geometry.Vector<double>(double.Parse(src.x.ToString()), double.Parse(src.y.ToString()), double.Parse(src.z.ToString()));
+    }
+    Vector3 o0VectorToUnity(o0.Geometry.Vector<double> src) {
+        return new Vector3(float.Parse(src.x.ToString()), float.Parse(src.y.ToString()), float.Parse(src.z.ToString()));
+    }
+
     [NonSerialized] public bool lerpForRotation = true;
     [NonSerialized] public float lerpTimeRate = 7;
     public void Update()

+ 44 - 29
Assets/BowArrow/Scripts/Bluetooth/o09AxisCS.cs

@@ -47,34 +47,27 @@ public class o09AxisCS
 
 
 
-    public Quaternion update(Vector3 AccOld, Vector3 GyrOld, Vector3 MagOld, long TimeGapOld)
+    public UnityEngine.Quaternion update(Vector3 Acc, Vector3 Gyr, Vector3 Mag, long TimeGap)
     {
+
         o0UIRawImageTester.UpdateAllOffset();
 
-        var Acc = this.AccOld;
-        var Gyr = (this.GyrOld + GyrOld) / 2;
-        var Mag = this.MagOld;
-        float TimeGap = this.TimeGapOld;
-        this.AccOld = AccOld;
-        this.GyrOld = GyrOld;
-        this.MagOld = MagOld;
-        this.TimeGapOld = TimeGapOld;
         var Last = States.LastOrDefault() ?? new State();
-        if (this.TimeGapOld <= 0)
-            return Last.Qua;
         States.Add(new State());
-        if (States.Count > 200)
+        if (States.Count > 50)
             States.RemoveAt(0);
         var state = States.Last();
         state.Acc = Acc;
 
         state.AccSmooth = AccFilter.Update(Acc);
 
+        //Debug.Log(Gyr.magnitude);
+
         state.Gyr = Gyr;
         state.Mag = Mag;/**/
         state.MagSmooth = MagFilter.Update(Mag);
         if (States.Count <= 1)
-            return Quaternion.identity;
+            return UnityEngine.Quaternion.identity;
 
         HardwareVarianceGyr.Update((Gyr).magnitude);//每毫秒方差2.331017E-09 度左右   0.00000002331017
         HardwareVarianceAcc.Update(Vector3.Angle(state.Acc, Last.Acc));//方差0.0012度左右
@@ -84,17 +77,39 @@ public class o09AxisCS
 
 
 
-        var GyrOperator = new Quaternion();
+        var GyrOperator = new UnityEngine.Quaternion();
         GyrOperator.eulerAngles = Gyr * TimeGap;
         var quaGyr = LastQuaternion * GyrOperator;
 
+
+        //TestVector.Update9AxisRotation(GyrOperator, 1);
+        //TestVector.SetAcc(Acc / 10, 1);
+        //TestVector.SetMag(Mag, 1);
+        var accTest = new UnityEngine.Quaternion();
+        accTest.SetFromToRotation(Last.Acc, Acc);
+        accTest.w *= -1;
+        // TestVector.Update9AxisRotation(accTest, 2);
+        var magTest = new UnityEngine.Quaternion();
+        magTest.SetFromToRotation(Last.Mag, Mag);
+        magTest.w *= -1;
+        // TestVector.Update9AxisRotation(magTest, 3);
+        //TestVector.Set9AxisRotation(Last.Qua, 3);
+
         double AccLengthToAngle = 360;//1倍引力差相当于多少度方差
         double MagLengthToAngle = 360;//1倍磁力差相当于多少度方差
 
-        double GyrVariance = 1 + Math.Pow((Gyr * TimeGap).magnitude, 2);//陀螺仪移动向量
-        double AccVariance = Math.Pow(Math.Max((Gyr * TimeGap).magnitude, Vector3.Angle(state.AccSmooth, Last.AccSmooth)), 2)
-            + (Math.Abs(state.AccSmooth.magnitude - 9.8) > 0.1 ? Math.Pow(Math.Abs(state.AccSmooth.magnitude - 9.8) / 9.8 * AccLengthToAngle, 4) : 0);
-        double MagVariance = Math.Pow(3, 2)
+        //double GyrVariance = 1 + Math.Pow((Gyr * TimeGap).magnitude, 0.5);//陀螺仪移动向量
+        double GyrVariance = Math.Pow((Gyr * TimeGap).magnitude + 0.225, 0.5);//陀螺仪移动向量
+        var modelVariance = Math.Pow(0.001 + (Gyr * TimeGap).magnitude * 0.3, 2);
+        double AccVariance = Math.Max(Math.Pow((Gyr * TimeGap).magnitude, 1), 1)
+            + (Math.Abs(state.AccSmooth.magnitude - 1) > 0.1 ? Math.Pow(Math.Abs(state.AccSmooth.magnitude - 1) / 1 * AccLengthToAngle, 4) : 0);
+        double MagVariance = 9
+            + (Math.Abs(state.MagSmooth.magnitude - 1) > 0.1 ? Math.Pow(Math.Abs(state.MagSmooth.magnitude - 1) * MagLengthToAngle, 4) : 0);//指数4其中2是引力2是方差/**/
+        /*
+        double GyrVariance = Math.Pow((Gyr * TimeGap).magnitude + 0.225, 0.5);//陀螺仪移动向量
+        double AccVariance = Math.Pow(Math.Max((Gyr * TimeGap).magnitude, Vector3.Angle(state.AccSmooth, Last.AccSmooth)), 0.5)
+            + (Math.Abs(state.AccSmooth.magnitude - 1) > 0.1 ? Math.Pow(Math.Abs(state.AccSmooth.magnitude - 1) / 1 * AccLengthToAngle, 4) : 0);
+        double MagVariance = Math.Pow(3, 1)
             + (Math.Abs(state.MagSmooth.magnitude - 1) > 0.1 ? Math.Pow(Math.Abs(state.MagSmooth.magnitude - 1) * MagLengthToAngle, 4) : 0);//指数4其中2是引力2是方差/**/
 
         //double AccGyrVariance = Last.AccVariance + GyrVariance;
@@ -162,18 +177,19 @@ public class o09AxisCS
         else
         {
             state.AccMagVariance = Math.Min(Last.AccMagVariance + Math.Max(GyrVariance - 1.0, 0), 10000);
-            state.QuaAccMag = Quaternion.Slerp(Last.QuaAccMag, quaAccMag, (float)(state.AccMagVariance / (state.AccMagVariance + AccMagVariance)));
+            state.QuaAccMag = UnityEngine.Quaternion.Slerp(Last.QuaAccMag, quaAccMag, (float)(state.AccMagVariance / (state.AccMagVariance + AccMagVariance)));
             state.AccMagVariance = state.AccMagVariance * AccMagVariance / (state.AccMagVariance + AccMagVariance);
         }
 
 
 
-        var modelVariance = Math.Max(GyrVariance - 1.1, 0) * 0.05;
+        //var modelVariance = Math.Max(GyrVariance, 0) * 0.05;
 
         state.GyrVariance = Math.Min(Last.GyrVariance + GyrVariance, 10000);
         //quaGyr = Quaternion.Slerp(Last.QuaSmooth, quaGyr, (float)(state.GyrVariance / (state.GyrVariance + GyrVariance)));
         state.GyrVariance = state.GyrVariance * GyrVariance / (state.GyrVariance + GyrVariance);
 
+        //Debug.Log(GyrVariance);
         /*
         if (state.AccMagVariance < GyrVariance && 1f > Last.GyrVariance)
         {
@@ -187,17 +203,15 @@ public class o09AxisCS
 
 
         state.AccVariance = Math.Min(Last.AccVariance + modelVariance, 10000);
-        //state.Qua = o0Project.o0.FormQuaternion(state.Qua, AccIdentity, state.AccSmooth, (float)(state.AccVariance / (state.AccVariance + AccVariance)));
-        //state.AccVariance = state.AccVariance * AccVariance / (state.AccVariance + AccVariance);
-        state.Qua = Quaternion.Slerp(state.Qua, quaAccMag, (float)(state.AccVariance / (state.AccVariance + AccMagVariance)));
-        state.AccVariance = state.AccVariance * AccMagVariance / (state.AccVariance + AccMagVariance);
+        state.Qua = o0Project.o0.FormQuaternion(state.Qua, AccIdentity, state.AccSmooth, (float)(state.AccVariance / (state.AccVariance + AccVariance)));
+        state.AccVariance = state.AccVariance * AccVariance / (state.AccVariance + AccVariance);
+        //state.Qua = UnityEngine.Quaternion.Slerp(state.Qua, quaAccMag, (float)(state.AccVariance / (state.AccVariance + AccMagVariance)));
+        //state.AccVariance = state.AccVariance * AccMagVariance / (state.AccVariance + AccMagVariance);
 
         ///////////////////////////////////////////////////////////////
         ///
         //var AccMagVariance = Math.Sqrt(AccVariance * AccVariance + MagVariance * MagVariance);
-
-
-
+        //state.Qua.eu
 
         /*
         state.TotalVariance = Math.Min(Last.TotalVariance + modelVariance * 0.3, 10000);
@@ -212,10 +226,9 @@ public class o09AxisCS
 
         ///////////////////////////////////////////////////////////////
 
-
         if (float.IsNaN(state.Qua.w))
             state.Qua = Last.Qua;/**/
-        state.QuaSmooth = Quaternion.Slerp(Last.QuaSmooth, state.Qua, 0.3f);//Last.QuaSmooth - state.Qua    0 - 1
+        state.QuaSmooth = UnityEngine.Quaternion.Slerp(Last.QuaSmooth, state.Qua, 0.3f);//Last.QuaSmooth - state.Qua    0 - 1
 
         var frontV = Last.Qua * Vector3.forward;
         var upV = Last.Qua * Vector3.up;
@@ -226,6 +239,8 @@ public class o09AxisCS
 
 
         //QuaTest[0] = o0Project.o0.FormQuaternion(QuaTest[0] * GyrOperator, AccIdentity, state.AccSmooth, 1);
+        // QuaTest[0] = o0Project.o0.FormQuaternion(AccIdentity, MagIdentity, state.AccSmooth, state.MagSmooth, (float)(AccVariance / (AccVariance + MagVariance)));
+        // QuaTest[1] = state.QuaAccMag;
         //QuaTest[1] = o0Project.o0.FormQuaternion(QuaTest[1] * GyrOperator, MagIdentity, state.MagSmooth, 1);
         //Debug.Log(o09AxisCS.QuaTest[0]);
         return state.QuaSmooth;

+ 124 - 0
Assets/BowArrow/Scripts/Bluetooth/o0DistanceToAxis.cs

@@ -0,0 +1,124 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using o0.Geometry;
+using o0.Num;
+using UnityEngine;
+
+namespace o0.Bow
+{
+    public class DistanceToAxis//测试版
+    {
+        public DistanceToAxis()
+        {
+            DistanceQueue = new SortedQueue<double>();
+            Distance = 0.6;
+        }
+        Vector<double> LastAcc;
+        Vector<double> LockAcc;//静止状态下加速计向量,仅通过陀螺仪短时校准,长时校准不保证准确性,也无必要性
+        double LockMS;
+        double LastGapMS;
+        Vector<double> Speed;//每秒
+        SortedQueue<double> DistanceQueue;
+        double Distance;
+        /////////////////////////////////////////////////Acc长度以1为标准
+        public void Update(Vector<double> Gyr, Vector<double> Acc, Vector<double> Mag, double GapMS)//务必仅在射箭瞄准游戏过程中调用
+        {
+            if(LastAcc == default)
+            {
+                LastAcc = Acc;
+                return;
+            }
+
+            if (Gyr.Length * 1000 < 1 // 陀螺仪计算的每秒移动小于1度
+                && (LastAcc - Acc).Length / GapMS * 1000 < 1// 加速计计算的每秒移动小于1度
+                && Acc.Length < 1.05
+                && Acc.Length > 0.95
+                && LastAcc.Length < 1.05
+                && LastAcc.Length > 0.95)//则当做静止状态,此时记录加速计长度
+            {
+                LockAcc = Acc;
+                LockMS = 0;
+                LastGapMS = GapMS;
+                Speed = Vector<double>.Zero;
+
+
+                //Debug.Log(Gyr.Length * 1000 + " | " + Acc.Length + " | " + (LastAcc - Acc).Length / GapMS * 1000);
+
+                LastAcc = Acc;
+                return;
+            }
+            if(LockAcc != default)
+            {
+                var GyrOperator = -Geometry.Quaternion.Euler(Gyr * GapMS);
+                LockAcc = GyrOperator * LockAcc;
+                Speed = GyrOperator * Speed;
+                Speed += (Acc - LockAcc) * 9.8 * (LastGapMS + GapMS) / 1000 / 2;
+
+                if (LockMS < 250 && Gyr.Length * 1000 > 5)
+                {
+                    var distance = Speed.Length / (Gyr.Length * 1000) * 180 / Math.PI;//臂长
+                    if(distance < 1)
+                    {
+                        if (DistanceQueue.Count > 100)
+                            DistanceQueue.Dequeue();
+                        DistanceQueue.Enqueue(distance);
+                        if(DistanceQueue.Count > 30)
+                        {
+                            var mid = DistanceQueue.Count >> 1;
+                            var max = mid + 10;
+                            var list = new List<double>();
+                            for (var i = mid - 9; i < max; ++i)
+                                list.Add(DistanceQueue[i]);
+                            Distance = list.Mean();
+                        }
+                    }
+                    //Debug.Log(Distance);
+                }
+
+                // TestVector.SetAcc((Acc - LockAcc).ToUnityVector(), 1);
+                // TestVector.SetMag(Speed.ToUnityVector(), 1);
+                //Debug.Log(Gyr.Length);
+
+                LastGapMS = GapMS;
+                LockMS += GapMS;
+            }
+            LastAcc = Acc;
+            return;
+        }
+
+
+        //默认轴在后方 z为负
+        //////// 米/秒                      度/毫秒
+        public Vector<double> GyrToSpeed(Vector<double> Gyr, double GapMS)
+        {
+            var GyrOperator = Geometry.Quaternion.Euler(Gyr * GapMS).Inversed;
+            var axis = Vector<double>.Back * Distance;
+            axis = (GyrOperator * axis - axis) / GapMS * 1000;
+            // TestVector.SetAcc(axis.ToUnityVector(), 2);
+            //Debug.Log(axis);
+            return axis;
+        }/**/
+        Vector<double> LastSpeed = default;
+        public Vector<double> AccCorrection(Vector<double> Gyr, Vector<double> Acc, double GapMS)
+        {
+            Vector<double> Speed = GyrToSpeed(Gyr, GapMS);
+            if (LastSpeed == default)
+            {
+                LastSpeed = Speed;
+                //Debug.Log(Acc.z);
+                //var Speed = 
+                return Acc;
+            }
+            var GyrOperator = Geometry.Quaternion.Euler(Gyr * GapMS).Inversed;
+            var RotatedLastSpeed = GyrOperator * LastSpeed;
+            var AccCorrection = (Speed - RotatedLastSpeed) / 9.8 / GapMS * 1000;
+            // TestVector.SetMag(AccCorrection.ToUnityVector(), 2);
+            // TestVector.SetAcc((Acc + AccCorrection).ToUnityVector(), 3);
+            LastSpeed = Speed;
+            return Acc + AccCorrection;//因为Acc是反的
+        }
+    }
+}

+ 11 - 0
Assets/BowArrow/Scripts/Bluetooth/o0DistanceToAxis.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: da1f7dea2fb495249bf4fe8e565e5286
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/HTTPConnection.cs

@@ -17,7 +17,7 @@ using BestHTTP.Authentication;
 
 #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
     using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
-    using Org.BouncyCastle.Crypto.Tls;
+    using Org.BouncyCastle.Crypto.Tls2;
 #endif
 
 #if !BESTHTTP_DISABLE_COOKIES

+ 2 - 2
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/HTTPManager.cs

@@ -174,12 +174,12 @@ namespace BestHTTP
         /// <summary>
         /// The default ICertificateVerifyer implementation that the plugin will use when the request's UseAlternateSSL property is set to true.
         /// </summary>
-        public static Org.BouncyCastle.Crypto.Tls.ICertificateVerifyer DefaultCertificateVerifyer { get; set; }
+        public static Org.BouncyCastle.Crypto.Tls2.ICertificateVerifyer DefaultCertificateVerifyer { get; set; }
 
         /// <summary>
         /// The default IClientCredentialsProvider implementation that the plugin will use when the request's UseAlternateSSL property is set to true.
         /// </summary>
-        public static Org.BouncyCastle.Crypto.Tls.IClientCredentialsProvider DefaultClientCredentialsProvider { get; set; }
+        public static Org.BouncyCastle.Crypto.Tls2.IClientCredentialsProvider DefaultClientCredentialsProvider { get; set; }
 
         /// <summary>
         /// The default value for the HTTPRequest's UseAlternateSSL property.

+ 2 - 2
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/HTTPRequest.cs

@@ -376,12 +376,12 @@ namespace BestHTTP
         /// <summary>
         /// The ICertificateVerifyer implementation that the plugin will use to verify the server certificates when the request's UseAlternateSSL property is set to true.
         /// </summary>
-        public Org.BouncyCastle.Crypto.Tls.ICertificateVerifyer CustomCertificateVerifyer { get; set; }
+        public Org.BouncyCastle.Crypto.Tls2.ICertificateVerifyer CustomCertificateVerifyer { get; set; }
 
         /// <summary>
         /// The IClientCredentialsProvider implementation that the plugin will use to send client certificates when the request's UseAlternateSSL property is set to true.
         /// </summary>
-        public Org.BouncyCastle.Crypto.Tls.IClientCredentialsProvider CustomClientCredentialsProvider { get; set; }
+        public Org.BouncyCastle.Crypto.Tls2.IClientCredentialsProvider CustomClientCredentialsProvider { get; set; }
 
         /// <summary>
         /// With this property custom Server Name Indication entries can be sent to the server while negotiating TLS. 

+ 1 - 1
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/AlwaysValidVerifyer.cs

@@ -4,7 +4,7 @@ using System;
 
 using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
 
-namespace Org.BouncyCastle.Crypto.Tls
+namespace Org.BouncyCastle.Crypto.Tls2
 {
 	/// <remarks>
 	/// A certificate verifyer, that will always return true.

+ 1 - 1
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/ICertificateVerifyer.cs

@@ -4,7 +4,7 @@ using System;
 
 using BestHTTP.SecureProtocol.Org.BouncyCastle.Asn1.X509;
 
-namespace Org.BouncyCastle.Crypto.Tls
+namespace Org.BouncyCastle.Crypto.Tls2
 {
 	/// <remarks>
 	/// This should be implemented by any class which can find out, if a given

+ 2 - 2
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsAuthentication.cs

@@ -1,9 +1,9 @@
-#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
+#if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
 
 using System;
 using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
 
-namespace Org.BouncyCastle.Crypto.Tls
+namespace Org.BouncyCastle.Crypto.Tls2
 {
     public interface IClientCredentialsProvider
     {

+ 1 - 1
Assets/DependAsset/Best HTTP (Pro)/BestHTTP/SecureProtocol/crypto/tls/LegacyTlsClient.cs

@@ -3,7 +3,7 @@
 using System;
 using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
 
-namespace Org.BouncyCastle.Crypto.Tls
+namespace Org.BouncyCastle.Crypto.Tls2
 {
 	/// <summary>
 	/// A temporary class to use LegacyTlsAuthentication

+ 8 - 0
Assets/Plugins/o0Lib.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1716ef306fb114d41aaf4a1ae813cc5b
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/BouncyCastle.Crypto.dll


+ 33 - 0
Assets/Plugins/o0Lib/BouncyCastle.Crypto.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 44fd247535bf85e42a6785f2221a6071
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/Fractions.dll


+ 33 - 0
Assets/Plugins/o0Lib/Fractions.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 2f0960a034a99364cb76607ace549a5c
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/Mono.Data.Sqlite.dll


+ 33 - 0
Assets/Plugins/o0Lib/Mono.Data.Sqlite.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 96990f96f2da97848a0e90d89b792df0
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/SixLabors.ImageSharp.dll


+ 33 - 0
Assets/Plugins/o0Lib/SixLabors.ImageSharp.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 230751fea2b384345853cac523abb96c
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Buffers.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Buffers.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 252a56e5762642840956686be90a849f
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Memory.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Memory.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: ff6be0ada764a774e8453c7ab03a1f77
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Numerics.Vectors.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Numerics.Vectors.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 2dc19c1ca6f5fb94c81221a72f672be4
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Reflection.Emit.ILGeneration.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Reflection.Emit.ILGeneration.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 229e27fb24bc13a47bcd9306f2829b09
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Reflection.Emit.Lightweight.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Reflection.Emit.Lightweight.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 19e74b0b42364724786447c0c403c2c1
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Runtime.CompilerServices.Unsafe.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Runtime.CompilerServices.Unsafe.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 6a508fbb94e44b94b98e0874c82e46e8
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/System.Text.Encoding.CodePages.dll


+ 33 - 0
Assets/Plugins/o0Lib/System.Text.Encoding.CodePages.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 608f97968c7ef114bb40e1f0760abd5b
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 263 - 0
Assets/Plugins/o0Lib/o0NetLib.deps.json

@@ -0,0 +1,263 @@
+{
+  "runtimeTarget": {
+    "name": ".NETStandard,Version=v2.0/",
+    "signature": ""
+  },
+  "compilationOptions": {},
+  "targets": {
+    ".NETStandard,Version=v2.0": {},
+    ".NETStandard,Version=v2.0/": {
+      "o0NetLib/1.0.0": {
+        "dependencies": {
+          "BouncyCastle": "1.8.9",
+          "Fractions": "7.0.0",
+          "Mono.Data.Sqlite": "1.0.61",
+          "NETStandard.Library": "2.0.3",
+          "SixLabors.ImageSharp": "2.1.1",
+          "System.Reflection.Emit.Lightweight": "4.7.0",
+          "System.Runtime.Numerics": "4.0.0",
+          "zlib.net": "1.0.4"
+        },
+        "runtime": {
+          "o0NetLib.dll": {}
+        }
+      },
+      "BouncyCastle/1.8.9": {
+        "runtime": {
+          "lib/BouncyCastle.Crypto.dll": {
+            "assemblyVersion": "1.8.9.0",
+            "fileVersion": "1.8.20343.1"
+          }
+        }
+      },
+      "Fractions/7.0.0": {
+        "dependencies": {
+          "System.Runtime.Numerics": "4.0.0"
+        },
+        "runtime": {
+          "lib/netstandard2.0/Fractions.dll": {
+            "assemblyVersion": "7.0.0.0",
+            "fileVersion": "7.0.0.0"
+          }
+        }
+      },
+      "Microsoft.NETCore.Platforms/1.1.0": {},
+      "Mono.Data.Sqlite/1.0.61": {
+        "runtime": {
+          "lib/net40/Mono.Data.Sqlite.dll": {
+            "assemblyVersion": "4.0.0.0",
+            "fileVersion": "1.0.61.0"
+          }
+        }
+      },
+      "NETStandard.Library/2.0.3": {
+        "dependencies": {
+          "Microsoft.NETCore.Platforms": "1.1.0"
+        }
+      },
+      "SixLabors.ImageSharp/2.1.1": {
+        "dependencies": {
+          "System.Buffers": "4.5.1",
+          "System.Memory": "4.5.4",
+          "System.Numerics.Vectors": "4.5.0",
+          "System.Runtime.CompilerServices.Unsafe": "5.0.0",
+          "System.Text.Encoding.CodePages": "5.0.0"
+        },
+        "runtime": {
+          "lib/netstandard2.0/SixLabors.ImageSharp.dll": {
+            "assemblyVersion": "2.0.0.0",
+            "fileVersion": "2.1.1.0"
+          }
+        }
+      },
+      "System.Buffers/4.5.1": {
+        "runtime": {
+          "lib/netstandard2.0/System.Buffers.dll": {
+            "assemblyVersion": "4.0.3.0",
+            "fileVersion": "4.6.28619.1"
+          }
+        }
+      },
+      "System.Memory/4.5.4": {
+        "dependencies": {
+          "System.Buffers": "4.5.1",
+          "System.Numerics.Vectors": "4.5.0",
+          "System.Runtime.CompilerServices.Unsafe": "5.0.0"
+        },
+        "runtime": {
+          "lib/netstandard2.0/System.Memory.dll": {
+            "assemblyVersion": "4.0.1.1",
+            "fileVersion": "4.6.28619.1"
+          }
+        }
+      },
+      "System.Numerics.Vectors/4.5.0": {
+        "runtime": {
+          "lib/netstandard2.0/System.Numerics.Vectors.dll": {
+            "assemblyVersion": "4.1.4.0",
+            "fileVersion": "4.6.26515.6"
+          }
+        }
+      },
+      "System.Reflection.Emit.ILGeneration/4.7.0": {
+        "runtime": {
+          "lib/netstandard2.0/System.Reflection.Emit.ILGeneration.dll": {
+            "assemblyVersion": "4.0.0.0",
+            "fileVersion": "4.700.19.56404"
+          }
+        }
+      },
+      "System.Reflection.Emit.Lightweight/4.7.0": {
+        "dependencies": {
+          "System.Reflection.Emit.ILGeneration": "4.7.0"
+        },
+        "runtime": {
+          "lib/netstandard2.0/System.Reflection.Emit.Lightweight.dll": {
+            "assemblyVersion": "4.0.0.0",
+            "fileVersion": "4.700.19.56404"
+          }
+        }
+      },
+      "System.Runtime.CompilerServices.Unsafe/5.0.0": {
+        "runtime": {
+          "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": {
+            "assemblyVersion": "5.0.0.0",
+            "fileVersion": "5.0.20.51904"
+          }
+        }
+      },
+      "System.Runtime.Numerics/4.0.0": {},
+      "System.Text.Encoding.CodePages/5.0.0": {
+        "dependencies": {
+          "System.Runtime.CompilerServices.Unsafe": "5.0.0"
+        },
+        "runtime": {
+          "lib/netstandard2.0/System.Text.Encoding.CodePages.dll": {
+            "assemblyVersion": "5.0.0.0",
+            "fileVersion": "5.0.20.51904"
+          }
+        }
+      },
+      "zlib.net/1.0.4": {
+        "runtime": {
+          "lib/zlib.net.dll": {
+            "assemblyVersion": "1.0.3.0",
+            "fileVersion": "1.0.3.0"
+          }
+        }
+      }
+    }
+  },
+  "libraries": {
+    "o0NetLib/1.0.0": {
+      "type": "project",
+      "serviceable": false,
+      "sha512": ""
+    },
+    "BouncyCastle/1.8.9": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-axnBgvdD5n+FnEG6efk/tfKuMFru7R/EoISH9zjh319yb3HD24TEHSAbNN/lTRT2ulOGRxDgOsCjkuk08iwWPg==",
+      "path": "bouncycastle/1.8.9",
+      "hashPath": "bouncycastle.1.8.9.nupkg.sha512"
+    },
+    "Fractions/7.0.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-1uv2IqQ6AsLtrcsibOTEyyHLQpxgjONssPrI0Ug84AIuSVqVDcotaNkTaJTprFvxbCNi7Kp/3WAAtnytuQP3qQ==",
+      "path": "fractions/7.0.0",
+      "hashPath": "fractions.7.0.0.nupkg.sha512"
+    },
+    "Microsoft.NETCore.Platforms/1.1.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
+      "path": "microsoft.netcore.platforms/1.1.0",
+      "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
+    },
+    "Mono.Data.Sqlite/1.0.61": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-o5bYhnYDlQ8qiDBDJEnnK/LlQnHzpAb6ixXdrZKcVGv26jBfSm58ujAR1NLBhs0h+R5782VufbaF6gzYq3iiaA==",
+      "path": "mono.data.sqlite/1.0.61",
+      "hashPath": "mono.data.sqlite.1.0.61.nupkg.sha512"
+    },
+    "NETStandard.Library/2.0.3": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
+      "path": "netstandard.library/2.0.3",
+      "hashPath": "netstandard.library.2.0.3.nupkg.sha512"
+    },
+    "SixLabors.ImageSharp/2.1.1": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-oNHMT8+yUR9dyuU2r7fwsXvvS4OnfCs9N5i2y2p9iBxp3nvEZbe/hZWrOGfD7MX2lxOAlWzlhzj0q2uFwP8avg==",
+      "path": "sixlabors.imagesharp/2.1.1",
+      "hashPath": "sixlabors.imagesharp.2.1.1.nupkg.sha512"
+    },
+    "System.Buffers/4.5.1": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==",
+      "path": "system.buffers/4.5.1",
+      "hashPath": "system.buffers.4.5.1.nupkg.sha512"
+    },
+    "System.Memory/4.5.4": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==",
+      "path": "system.memory/4.5.4",
+      "hashPath": "system.memory.4.5.4.nupkg.sha512"
+    },
+    "System.Numerics.Vectors/4.5.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==",
+      "path": "system.numerics.vectors/4.5.0",
+      "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512"
+    },
+    "System.Reflection.Emit.ILGeneration/4.7.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-AucBYo3DSI0IDxdUjKksBcQJXPHyoPyrCXYURW1WDsLI4M65Ar/goSHjdnHOAY9MiYDNKqDlIgaYm+zL2hA1KA==",
+      "path": "system.reflection.emit.ilgeneration/4.7.0",
+      "hashPath": "system.reflection.emit.ilgeneration.4.7.0.nupkg.sha512"
+    },
+    "System.Reflection.Emit.Lightweight/4.7.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==",
+      "path": "system.reflection.emit.lightweight/4.7.0",
+      "hashPath": "system.reflection.emit.lightweight.4.7.0.nupkg.sha512"
+    },
+    "System.Runtime.CompilerServices.Unsafe/5.0.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==",
+      "path": "system.runtime.compilerservices.unsafe/5.0.0",
+      "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512"
+    },
+    "System.Runtime.Numerics/4.0.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-aAYGEOE01nabQLufQ4YO8WuSyZzOqGcksi8m1BRW8ppkmssR7en8TqiXcBkB2gTkCnKG/Ai2NQY8CgdmgZw/fw==",
+      "path": "system.runtime.numerics/4.0.0",
+      "hashPath": "system.runtime.numerics.4.0.0.nupkg.sha512"
+    },
+    "System.Text.Encoding.CodePages/5.0.0": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-NyscU59xX6Uo91qvhOs2Ccho3AR2TnZPomo1Z0K6YpyztBPM/A5VbkzOO19sy3A3i1TtEnTxA7bCe3Us+r5MWg==",
+      "path": "system.text.encoding.codepages/5.0.0",
+      "hashPath": "system.text.encoding.codepages.5.0.0.nupkg.sha512"
+    },
+    "zlib.net/1.0.4": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "sha512-ywKkVY1y20tGQsUnYgKupYm91L8GVrVgoEOFTjfR1Bb5Xiy5tBJu5SV9liIiW2h8/KQUBefE45vSythtNMmahQ==",
+      "path": "zlib.net/1.0.4",
+      "hashPath": "zlib.net.1.0.4.nupkg.sha512"
+    }
+  }
+}

+ 7 - 0
Assets/Plugins/o0Lib/o0NetLib.deps.json.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4593cc48cb43a58429a34a9705539735
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/o0NetLib.dll


+ 33 - 0
Assets/Plugins/o0Lib/o0NetLib.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: e13dab309567c5847a70e24d05e9ed6b
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/o0NetLib.pdb


+ 7 - 0
Assets/Plugins/o0Lib/o0NetLib.pdb.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 6515bc2df92dd2e4c958a41349db743d
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/Plugins/o0Lib/zlib.net.dll


+ 33 - 0
Assets/Plugins/o0Lib/zlib.net.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: 2c3ede951f6a6174e8dec3c1d1fc32b5
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 276 - 0
代码备份/2022-8-9/o09AxisCS.cs

@@ -0,0 +1,276 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+public class o09AxisCS
+{
+    static public Vector3 AccIdentity = new Vector3(0, -1, 0);
+    static public Vector3 MagIdentity = new Vector3(-1, 2, 0).normalized;
+    public class State
+    {
+        public long TimeGap;
+        public Vector3 Acc = AccIdentity;
+        public Vector3 AccSmooth = AccIdentity;
+
+        public Vector3 Gyr;
+        public Vector3 Mag = MagIdentity;
+        public Vector3 MagSmooth = MagIdentity;
+        public Quaternion Qua = Quaternion.identity;
+        public Quaternion QuaSmooth = Quaternion.identity;
+        public double GyrVariance = 1;
+        public double AccVariance = 1;
+        public double MagVariance = 1;
+        public Quaternion QuaAccMag = Quaternion.identity;
+        public int QuaAccMagCount = 0;
+        public double AccMagVariance = 1;
+        public double TotalVariance = 1;
+    }
+
+    o0Project.Variance HardwareVarianceGyr = new o0Project.Variance(1000);
+    o0Project.Variance HardwareVarianceAcc = new o0Project.Variance(1000);
+    o0Project.Variance HardwareVarianceMag = new o0Project.Variance(1000);
+
+    public List<State> States = new List<State>();
+
+    public Vector3 AccOld;
+    public Vector3 GyrOld;
+    public Vector3 MagOld;
+
+    public float x;
+    public float y;
+    public float z;
+
+    long TimeGapOld;
+    o0Aien.o0WeightedAverageFilterVector3 AccFilter = new o0Aien.o0WeightedAverageFilterVector3(1);
+    o0Aien.o0WeightedAverageFilterVector3 MagFilter = new o0Aien.o0WeightedAverageFilterVector3(1);
+
+
+
+    public Quaternion update(Vector3 AccOld, Vector3 GyrOld, Vector3 MagOld, long TimeGapOld)
+    {
+        o0UIRawImageTester.UpdateAllOffset();
+
+        var Acc = this.AccOld;
+        var Gyr = (this.GyrOld + GyrOld) / 2;
+        var Mag = this.MagOld;
+        float TimeGap = this.TimeGapOld;
+        this.AccOld = AccOld;
+        this.GyrOld = GyrOld;
+        this.MagOld = MagOld;
+        this.TimeGapOld = TimeGapOld;
+        var Last = States.LastOrDefault() ?? new State();
+        if (this.TimeGapOld <= 0)
+            return Last.Qua;
+        States.Add(new State());
+        if (States.Count > 200)
+            States.RemoveAt(0);
+        var state = States.Last();
+        state.Acc = Acc;
+
+        state.AccSmooth = AccFilter.Update(Acc);
+
+        state.Gyr = Gyr;
+        state.Mag = Mag;/**/
+        state.MagSmooth = MagFilter.Update(Mag);
+        if (States.Count <= 1)
+            return Quaternion.identity;
+
+        HardwareVarianceGyr.Update((Gyr).magnitude);//每毫秒方差2.331017E-09 度左右   0.00000002331017
+        HardwareVarianceAcc.Update(Vector3.Angle(state.Acc, Last.Acc));//方差0.0012度左右
+        HardwareVarianceMag.Update(Vector3.Angle(state.Mag, Last.Mag));//方差3.5度左右
+
+        var LastQuaternion = Last.Qua;
+
+
+
+        var GyrOperator = new Quaternion();
+        GyrOperator.eulerAngles = Gyr * TimeGap;
+        var quaGyr = LastQuaternion * GyrOperator;
+
+        double AccLengthToAngle = 360;//1倍引力差相当于多少度方差
+        double MagLengthToAngle = 360;//1倍磁力差相当于多少度方差
+
+        double GyrVariance = 1 + Math.Pow((Gyr * TimeGap).magnitude, 2);//陀螺仪移动向量
+        double AccVariance = Math.Pow(Math.Max((Gyr * TimeGap).magnitude, Vector3.Angle(state.AccSmooth, Last.AccSmooth)), 2)
+            + (Math.Abs(state.AccSmooth.magnitude - 9.8) > 0.1 ? Math.Pow(Math.Abs(state.AccSmooth.magnitude - 9.8) / 9.8 * AccLengthToAngle, 4) : 0);
+        double MagVariance = Math.Pow(3, 2)
+            + (Math.Abs(state.MagSmooth.magnitude - 1) > 0.1 ? Math.Pow(Math.Abs(state.MagSmooth.magnitude - 1) * MagLengthToAngle, 4) : 0);//指数4其中2是引力2是方差/**/
+
+        //double AccGyrVariance = Last.AccVariance + GyrVariance;
+        //double MagGyrVariance = Last.MagVariance + GyrVariance;// 指数4 = 方差2 * 欧拉角旋转误差2     移动导致累计误差
+
+        //Debug.Log((Gyr * TimeGap).magnitude * 0.1);
+
+
+        //state.MagVariance = MagGyrVariance;
+        //state.MagVariance = state.MagVariance * MagVariance / (state.MagVariance + MagVariance);
+        //state.AccVariance = AccGyrVariance;
+        //state.AccVariance = state.AccVariance * AccVariance / (state.AccVariance + AccVariance);
+
+        //if (double.IsNaN(MagGyrVariance))
+        //    MagGyrVariance = double.MinValue;
+        if (double.IsNaN(GyrVariance))
+            GyrVariance = double.MinValue;
+        if (double.IsNaN(AccVariance))
+            AccVariance = double.MinValue;
+        if (double.IsNaN(MagVariance))
+            MagVariance = double.MinValue;
+        if (double.IsNaN(state.GyrVariance))
+            state.GyrVariance = double.MinValue;
+        if (double.IsNaN(state.AccVariance))
+            state.AccVariance = double.MinValue;
+        if (double.IsNaN(state.MagVariance))
+            state.MagVariance = double.MinValue;
+
+        /////////////////////////////////////////////////临时代码
+
+
+        //var quaAccMag = o0Project.o0.FormQuaternion(AccIdentity, MagIdentity, state.AccSmooth, state.MagSmooth, (float)(AccVariance / (AccVariance + MagVariance)));
+
+        //var tempQuaGyr = Quaternion.Slerp(Last.QuaSmooth, state.Qua, 0.5f);
+
+        var quaAccMag = o0Project.o0.FormQuaternion(AccIdentity, MagIdentity, state.AccSmooth, state.MagSmooth, 1);
+        /*
+        if (state.QuaAccMagCount == 0)
+            state.QuaAccMag = quaAccMag;
+        else
+            state.QuaAccMag = Quaternion.Slerp(state.QuaAccMag, quaAccMag, state.QuaAccMagCount / (state.QuaAccMagCount + 1));
+        ++state.QuaAccMagCount;/**/
+
+        ///////////////////////////////////////////////////
+        //var quaMagRate = MagGyrVariance / (MagGyrVariance + MagVariance);
+        //var quaAccRate = MagGyrVariance / (MagGyrVariance + MagVariance);
+        /*
+
+        var quaMinRate = GyrVariance / (GyrVariance + Math.Max(AccVariance, MagVariance));
+        var quaMaxRate = GyrVariance / (GyrVariance + Math.Min(AccVariance, MagVariance));
+        Quaternion quaFirst = Quaternion.Slerp(quaGyr, quaAccMag, (float)quaMinRate).normalized;
+        if (float.IsNaN(quaFirst.w))
+            quaFirst = Last.Qua;
+
+        var quaSecondRate = (quaMaxRate - quaMinRate) / (1 - quaMinRate);
+
+        state.Qua = AccVariance < MagVariance ? o0Project.o0.FormQuaternion(quaFirst, AccIdentity, state.AccSmooth, (float)quaSecondRate) : o0Project.o0.FormQuaternion(quaFirst, MagIdentity, state.MagSmooth, (float)quaSecondRate);
+        /**/
+        var AccMagVariance = AccVariance + MagVariance;
+        if (GyrVariance > 2f)
+        {
+            state.AccMagVariance = 25;
+            state.QuaAccMag = quaGyr;
+        }
+        else
+        {
+            state.AccMagVariance = Math.Min(Last.AccMagVariance + Math.Max(GyrVariance - 1.0, 0), 10000);
+            state.QuaAccMag = Quaternion.Slerp(Last.QuaAccMag, quaAccMag, (float)(state.AccMagVariance / (state.AccMagVariance + AccMagVariance)));
+            state.AccMagVariance = state.AccMagVariance * AccMagVariance / (state.AccMagVariance + AccMagVariance);
+        }
+
+
+
+        var modelVariance = Math.Max(GyrVariance - 1.1, 0) * 0.05;
+
+        state.GyrVariance = Math.Min(Last.GyrVariance + GyrVariance, 10000);
+        //quaGyr = Quaternion.Slerp(Last.QuaSmooth, quaGyr, (float)(state.GyrVariance / (state.GyrVariance + GyrVariance)));
+        state.GyrVariance = state.GyrVariance * GyrVariance / (state.GyrVariance + GyrVariance);
+
+        /*
+        if (state.AccMagVariance < GyrVariance && 1f > Last.GyrVariance)
+        {
+            Debug.Log("o0 static");
+            quaGyr = Quaternion.Slerp(Last.QuaSmooth, quaGyr, (float)(state.AccMagVariance / (state.AccMagVariance + GyrVariance)));
+        }/**/
+
+        state.MagVariance = Math.Min(Last.MagVariance + modelVariance, 10000);
+        state.Qua = o0Project.o0.FormQuaternion(quaGyr, MagIdentity, state.MagSmooth, (float)(state.MagVariance / (state.MagVariance + MagVariance)));
+        state.MagVariance = state.MagVariance * MagVariance / (state.MagVariance + MagVariance);
+
+
+        state.AccVariance = Math.Min(Last.AccVariance + modelVariance, 10000);
+        //state.Qua = o0Project.o0.FormQuaternion(state.Qua, AccIdentity, state.AccSmooth, (float)(state.AccVariance / (state.AccVariance + AccVariance)));
+        //state.AccVariance = state.AccVariance * AccVariance / (state.AccVariance + AccVariance);
+        state.Qua = Quaternion.Slerp(state.Qua, quaAccMag, (float)(state.AccVariance / (state.AccVariance + AccMagVariance)));
+        state.AccVariance = state.AccVariance * AccMagVariance / (state.AccVariance + AccMagVariance);
+
+        ///////////////////////////////////////////////////////////////
+        ///
+        //var AccMagVariance = Math.Sqrt(AccVariance * AccVariance + MagVariance * MagVariance);
+
+
+
+
+        /*
+        state.TotalVariance = Math.Min(Last.TotalVariance + modelVariance * 0.3, 10000);
+        if (state.TotalVariance > 25)
+            state.TotalVariance = 25;
+        if (state.AccMagVariance < 4)
+        {
+            state.Qua = Quaternion.Slerp(state.Qua, state.QuaAccMag, (float)(state.TotalVariance / (state.TotalVariance + state.AccMagVariance)));
+            state.TotalVariance = state.TotalVariance * state.AccMagVariance / (state.TotalVariance + state.AccMagVariance);
+        }/**/
+
+
+        ///////////////////////////////////////////////////////////////
+
+
+        if (float.IsNaN(state.Qua.w))
+            state.Qua = Last.Qua;/**/
+        state.QuaSmooth = Quaternion.Slerp(Last.QuaSmooth, state.Qua, 0.3f);//Last.QuaSmooth - state.Qua    0 - 1
+
+        var frontV = Last.Qua * Vector3.forward;
+        var upV = Last.Qua * Vector3.up;
+
+        x = (Mathf.Atan(upV.y / upV.z) / Mathf.PI * 180 + (upV.z < 0 ? 90 : 270));
+        y = (Mathf.Atan(frontV.z / frontV.x) / Mathf.PI * 180 + (frontV.x < 0 ? 90 : 270));
+        z = (Mathf.Atan(upV.y / upV.x) / Mathf.PI * 180 + (upV.x < 0 ? 90 : 270));
+
+
+        //QuaTest[0] = o0Project.o0.FormQuaternion(QuaTest[0] * GyrOperator, AccIdentity, state.AccSmooth, 1);
+        //QuaTest[1] = o0Project.o0.FormQuaternion(QuaTest[1] * GyrOperator, MagIdentity, state.MagSmooth, 1);
+        //Debug.Log(o09AxisCS.QuaTest[0]);
+        return state.QuaSmooth;
+    }
+
+    public void SetIdentity()
+    {
+        //Quaternion qua = default;
+
+        int averageCount = Math.Max(States.Count, 10);
+        Vector3 aveAcc = Vector3.zero;
+        Vector3 aveMag = Vector3.zero;
+        for (var i = 0; i < averageCount; ++i)
+        {
+            aveAcc += States[i].Acc;
+            aveMag += States[i].Mag;
+        }
+        aveAcc /= averageCount;
+        aveMag /= averageCount;
+        //AccIdentity = AccOld;
+        //MagIdentity = MagOld;
+        AccIdentity = aveAcc;
+        MagIdentity = aveMag;
+        //qua = o0Project.o0.FormQuaternion(Quaternion.identity, Vector3.down,AccIdentity, 1);
+        //AccIdentity=qua*AccIdentity;
+        //MagIdentity = qua*MagIdentity;
+        States.Last().Qua = Quaternion.identity;
+        States.Last().QuaSmooth = Quaternion.identity;
+        //States.Last().Qua = qua*States.Last().Qua;//Quaternion.identity;
+        States.Last().AccVariance = 0.0000001;
+        States.Last().GyrVariance = 0.0000001;
+        States.Last().MagVariance = 0.0000001;
+        States.Last().QuaAccMag = Quaternion.identity;
+        States.Last().QuaAccMagCount = 0;
+        States.Last().AccMagVariance = 0.0000001;
+        States.Last().TotalVariance = 0.0000001;
+    }
+
+    public State getLastState()
+    {
+        return this.States.Last();
+    }
+
+    public Vector3 getGyrOld()
+    {
+        return GyrOld;
+    }
+}