gpt4 book ai didi

java - ARCore 是否有像 ARKit 那样的 session 委托(delegate)方法?

转载 作者:行者123 更新时间:2023-12-02 12:41:34 25 4
gpt4 key购买 nike

在 ARKit 中有一个 ARSessionDelegate协议(protocol)有 4 种主要方法,您可以实现从 AR session 接收捕获的视频帧图像和跟踪状态。

ARCore API 是否有类似的协议(protocol)(接口(interface))和类似的方法?

override func viewDidLoad() {  
super.viewDidLoad()
sceneView.session.delegate = self // ARSessionDelegate? protocol
}

  1. This method provides a newly captured ARCamera image and accompanying AR information to the delegate:

func session(ARSession, didUpdate: ARFrame) { ... }

  1. This method tells the delegate that one or more ARAnchors have been added to the session:

func session(ARSession, didAdd: [ARAnchor]) { ... }

  1. This method tells the delegate that the ARSession has adjusted the properties of one or more ARAnchors:

func session(ARSession, didUpdate: [ARAnchor]) { ... }

  1. This method tells the delegate that one or more ARAnchors have been removed from the ARSession:

func session(ARSession, didRemove: [ARAnchor]) { ... }

如果 ARCore 中存在类似的方法(甚至不是全部),请向我展示它们在使用 Kotlin 代码时的样子。

任何帮助表示赞赏。

最佳答案

在浏览了 ARCore 文档后,我发现至少有两种类似的方法:

First: This method is used for receiving a new camera frame, updating the location of the device, updating the location of tracking anchors, updating detected planes, etc.


ArStatus ArSession_update(ArSession *session, ArFrame *out_frame)

Second: This method defines a tracked location in the physical world:


ArStatus ArSession_acquireNewAnchor(ArSession *session, const ArPose *pose, ArAnchor **out_anchor)

关于java - ARCore 是否有像 ARKit 那样的 session 委托(delegate)方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55794972/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com