I'm trying to create custom ARSCNView.
class CustomARSCNView: ARSCNView, ARSessionDelegate, ARSCNViewDelegate {
override init(frame: CGRect) {
super.init(frame: frame)
loadWorldMap()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
loadWorldMap()
}
override init(frame: CGRect, options: [String : Any]? = nil) {
super.init(frame: frame, options: options)
loadWorldMap()
}
public func loadWorldMap () {
let config = ARWorldTrackingConfiguration()
config.planeDetection = .horizontal
config.environmentTexturing = .automatic
self.debugOptions = [ARSCNDebugOptions.showFeaturePoints, .showWorldOrigin]
session.run(config, options: [.resetTracking, .removeExistingAnchors])
self.session.delegate = self
}
}
Everything works pretty cool, any attached session method is called predictably, but unfortunately renderer methods not running at all. Is there any mistake in my code?