Had to move some code around to get it to work. I think the main issue was declaring arSession as a class variable instead of within the initialiser.
class RoomCaptureController: RoomCaptureViewDelegate, RoomCaptureSessionDelegate, ObservableObject
{
var roomCaptureView: RoomCaptureView
var sessionConfig: RoomCaptureSession.Configuration
init() {
roomCaptureView = RoomCaptureView(frame: CGRect(x: 0, y: 0, width: 42, height: 42))//, arSession: arSession)
sessionConfig = RoomCaptureSession.Configuration()
let arConfig = ARWorldTrackingConfiguration()
arConfig.worldAlignment = .gravityAndHeading
roomCaptureView.captureSession.arSession.run(arConfig)
roomCaptureView.captureSession.delegate = self
roomCaptureView.delegate = self
}
}
Topic:
Spatial Computing
SubTopic:
General
Tags: