【问题标题】:Glitch in ARViewARView 中的故障
【发布时间】:2021-05-06 04:01:37
【问题描述】:

我有一个 iOS 应用程序,您可以在其中通过点击按钮打开 AR 视图。然而,在从我的导航控制器弹出视图并再次点击 AR 按钮后,摄像头馈送中发生了一些不寻常的事情。我看到我之前的 ar 会话的最后一帧突然出现,在整个会话期间来来去去。我正在使用 RealityKit。有什么想法吗?

  override func viewDidLoad() {
    super.viewDidLoad()
    focusSquare = FocusEntity(on: arview, style: .classic(color: .yellow))
    setupCoachingOverlay()
  }
   
  override func viewWillAppear(_ animated: Bool) {
    self.navigationController?.isNavigationBarHidden = true
  }
   
  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    UIApplication.shared.isIdleTimerDisabled = true
    resetTracking()
  }

  override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    arview.session.pause()
  }
   
  deinit{
    arview.session.delegate = nil
    arview.scene.anchors.removeAll()
    arview.removeFromSuperview()
    arview = nil
  }

  func resetTracking() {
    arview.automaticallyConfigureSession = false
    let configuration = ARWorldTrackingConfiguration()
    configuration.planeDetection = [.horizontal, .vertical]
    arview.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
    arview.scene.addAnchor(anchor)
  }

【问题讨论】:

    标签: ios swift realitykit


    【解决方案1】:

    看来FocusSquare 有问题。现在已修复,我已将其删除。

    【讨论】:

      猜你喜欢
      • 2023-04-08
      • 2016-09-09
      • 1970-01-01
      • 2020-04-18
      • 1970-01-01
      • 1970-01-01
      • 2016-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多