Exemple #1
0
 void StartNoDetectionTimer()
 {
     CancelNoDetectionTimer();
     noDetectionTimer = NSTimer.CreateScheduledTimer(5.0, (timer) =>
     {
         CancelNoDetectionTimer();
         sessionInfo.DisplayMessage("Unable to detect the object. Please point the device at the scanned object or rescan.", 5.0);
     });
 }
 public override void DidAddNode(ISCNSceneRenderer renderer, SCNNode node, ARAnchor anchor)
 {
     if (anchor != null && anchor is ARObjectAnchor)
     {
         var objectAnchor = anchor as ARObjectAnchor;
         if (source.ActiveTestRun != null && objectAnchor.ReferenceObject == source.ActiveTestRun.ReferenceObject)
         {
             source.ActiveTestRun.SuccessfulDetection(objectAnchor);
             var messageText = $"Object successfully detected from this angle.\n{source.ActiveTestRun.Statistics}";
             sessionInfo.DisplayMessage(messageText, source.ActiveTestRun.ResultDisplayDuration.TotalSeconds);
         }
     }
     else
     {
         if (source.State.CurrentState == AppState.Scanning && anchor is ARPlaneAnchor)
         {
             var planeAnchor = anchor as ARPlaneAnchor;
             source.CurrentScan?.ScannedObject.TryToAlignWithPlanes(new[] { planeAnchor });
         }
     }
 }