In ARKit there's a ARSessionDelegate
protocol what has 4 main methods you can implement to receive captured video frame images and tracking state from an AR session.
Does ARCore API have a similar protocol (interface) with similar methods?
override func viewDidLoad() {
super.viewDidLoad()
sceneView.session.delegate = self // ARSessionDelegate? protocol
}
- This method provides a newly captured ARCamera image and accompanying AR information to the delegate:
func session(ARSession, didUpdate: ARFrame) { ... }
- This method tells the delegate that one or more ARAnchors have been added to the session:
func session(ARSession, didAdd: [ARAnchor]) { ... }
- This method tells the delegate that the ARSession has adjusted the properties of one or more ARAnchors:
func session(ARSession, didUpdate: [ARAnchor]) { ... }
- This method tells the delegate that one or more ARAnchors have been removed from the ARSession:
func session(ARSession, didRemove: [ARAnchor]) { ... }
If similar methods (even not all of them) exist in ARCore, please show me how they look like using Kotlin code.
Any help appreciated.
After going through an ARCore documentation I discovered at least two similar methods:
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.