public void ResetSmartTerrain() { if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null)) { Debug.Log("Resetting Smart Terrain"); SmartTerrainTracker stTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); bool trackerWasActive = stTracker.IsActive; // first stop the tracker if (trackerWasActive) { stTracker.Stop(); } // now you can reset... mReconstructionBehaviour.Reconstruction.Reset(); // ... and restart the tracker if (trackerWasActive) { stTracker.Start(); mReconstructionBehaviour.Reconstruction.Start(); } // After a Reset, the ST reconstruction will be active again, // so we need to sync the UI Button startBtn = base.FindUISelectableWithText <Button>("Start"); if (startBtn) { startBtn.GetComponentInChildren <Text>().text = "Stop"; } } }
public void restart() { if (mTracker == null || mReconstructionBehaviour == null) { mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); mReconstructionBehaviour = (ReconstructionBehaviour)FindObjectOfType(typeof(ReconstructionBehaviour)); } if ((mReconstructionBehaviour != null) && (mReconstructionBehaviour.Reconstruction != null)) { bool trackerWasActive = mTracker.IsActive; // first stop the tracker if (trackerWasActive) { mTracker.Stop(); } // now you can reset... mReconstructionBehaviour.Reconstruction.Reset(); // ... and restart the tracker if (trackerWasActive) { mTracker.Start(); mReconstructionBehaviour.Reconstruction.Start(); } } }
// Use this for initialization void Start() { mReconstructionBehaviour = GetComponent <ReconstructionBehaviour>(); mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); //StartCoroutine(WaitForTenSeconds()); }
public override void Bind() { this.View.mCloseButton.TappedOn += OnTappedToClose; this.View.mAboutLabel.TappedOn += OnTappedOnAboutButton; this.View.mCameraFlashSettings.TappedOn += OnTappedToTurnOnFlash; this.View.mAutoFocusSetting.TappedOn += OnTappedToTurnOnAutoFocus; this.View.mStartStopScanning.TappedOn += OnTappedOnScanning; this.View.mReset.TappedOn += OnTappedOnReset; EnableContinuousAutoFocus(); mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); }
//对回调函数进行注册 void Start() { //获取Smart Terrain Tracker 与 Reconstruction mReconstructionBehaviour = GetComponent <ReconstructionBehaviour>(); DT_Tracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); if (mReconstructionBehaviour) { mReconstructionBehaviour.RegisterInitializedCallback(OnInitialized); mReconstructionBehaviour.RegisterPropCreatedCallback(OnPropCreated); mReconstructionBehaviour.RegisterSurfaceCreatedCallback(OnSurfaceCreated); } }
public void saveMesh() { if (mTracker == null || mReconstructionBehaviour == null) { mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); mReconstructionBehaviour = (ReconstructionBehaviour)FindObjectOfType(typeof(ReconstructionBehaviour)); } IEnumerable <Prop> propIEnu = mReconstructionBehaviour.GetActiveProps(); IEnumerator <Prop> e = propIEnu.GetEnumerator(); int count = 0; while (e.MoveNext()) { count++; var mf = wall.GetComponent <MeshFilter>(); var mesh = mf.sharedMesh; mesh.vertices = e.Current.GetMesh().vertices; mesh.triangles = e.Current.GetMesh().triangles; //Object tempMesh = e.Current.GetMesh(); //Vector3[] temp = e.Current.GetMesh().vertices; //int[] b =e.Current.GetMesh().triangles; //Debug.Log(e.Current.GetMesh().vertexCount); //foreach(Vector3 a in temp) //{ // Debug.Log("coord= "+a); //} //foreach (int a in b) //{ // Debug.Log("tri= " + a); //} //SaveObjectToFile(tempMesh, "Assets/data" + count+".obj"); } Debug.Log("count= " + count); }
// Use this for initialization void Start() { mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); mReconstructionBehaviour = (ReconstructionBehaviour)FindObjectOfType(typeof(ReconstructionBehaviour)); }
// Use this for initialization void Start() { mReconstructionBehaviour = GetComponent <ReconstructionBehaviour>(); mTracker = TrackerManager.Instance.GetTracker <SmartTerrainTracker>(); }