I'd like to grab the current camera frame in visionOS. I have a Swift file (am new to Swift) that looks like this:
import ARKit
import SwiftUI
class ARSessionManager: NSObject, ObservableObject, ARSessionDelegate {
var arSession: ARSession
override init() {
arSession = ARSession()
super.init()
arSession.delegate = self
}
func startSession() {
let configuration = ARWorldTrackingConfiguration()
configuration.planeDetection = .horizontal
arSession.run(configuration)
}
// ARSessionDelegate method to capture frames
func session(_ session: ARSession, didUpdate frame: ARFrame) {
// Process the frame, e.g., capture image data
}
}
and I get errors including "Cannot find type 'ARSessionDelegate' in scope". Help? Is ARFrame called something different for Vision Pro?