Ver código fonte

上传点云自动匹配代码,未完成版,缺接口

蓝色星空 1 ano atrás
pai
commit
3d94f3dedc

Diferenças do arquivo suprimidas por serem muito extensas
+ 85 - 5
Assets/MRNavigatorProTest.unity


+ 7 - 0
Assets/Scripts/Blue/AbstractController.cs

@@ -0,0 +1,7 @@
+using Blue;
+using UnityEngine;
+
+public class AbstractController : MonoBehaviour,IController
+{
+
+}

+ 11 - 0
Assets/Scripts/Blue/AbstractController.cs.meta

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

+ 46 - 0
Assets/Scripts/Blue/Controller/PointCouldAutoMatchController.cs

@@ -0,0 +1,46 @@
+using Blue;
+using UnityEngine;
+
+public class PointCouldAutoMatchController : AbstractController
+{
+    public GameObject AR_Map;
+    public GameObject obj_A;
+    public Vector3 obj_AVec;
+
+    public GameObject obj_origin;
+    public Vector3 OriginVec;
+
+    public BindableProperty<float> A_X ;
+
+    public Vector2 pos1;
+    public Vector2 pos2;
+    public double angle;
+
+    private void Awake()
+    {
+        A_X = new BindableProperty<float>(obj_A.transform.position.x);
+        A_X.Subscribe(PointChange);
+    }
+
+    private void PointChange(float obj)
+    {
+        Auto();
+    }
+
+    private void Auto()
+    {
+        angle = this.GetUtility<IGetAngleByTwoPointUtility>().GetAngleByTwoPoint(pos1,pos2);
+        AR_Map.transform.localEulerAngles = new Vector3(0.0f, (float)angle, 0.0f);
+        AR_Map.transform.localEulerAngles = new Vector3(0.0f, 16.6f, 0.0f);
+        AR_Map.transform.localPosition = OriginVec;
+    }
+
+    void Update()
+    {
+        OriginVec = obj_origin.transform.position;
+
+        obj_AVec = obj_A.transform.position;
+
+        A_X.Value = obj_A.transform.position.x;
+    }
+}

+ 11 - 0
Assets/Scripts/Blue/Controller/PointCouldAutoMatchController.cs.meta

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

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff