I have next code:
guard let feauturePoint = frame.hitTest(normalizedPoint, types: .featurePoint).first?.worldTransform else {
return
}
let anchor = MyAnchorSubclass(transform: feauturePoint, plus: someAdditionalInfo)
arSession.add(anchor: anchor)
This function creates and adds object of my subclass of ARAnchor. Then...
func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) {
guard let anchor = anchor as? MyAnchorSubclass else { return }
anchors.append(anchor)
/* then goes some my logic with adding SCNNode */
}
... after anchor was rendered, I'm adding my SCNNode there. But, when I'm using anchors.append(anchor)
, where anchors
is [MyAnchorSubclass]
, scene freezes right after 14 added anchors. If I'm not saving anchor in array, scene view does not freezes.
Does anyone know what is it? iOS 11 Beta bug or some kind of limitations?
UPDATE
Last, what happens - is renderer(_:didUpdate:for:)
being called and after it scene view freezes and few [Technique] World tracking performance is being affected by resource constraints [0]
messages appears in log.
UPDATE 1
Interesting fact: after app goes to the background and returns back, sessionWasInterrupted(:)
and sessionInterruptionEnded(:)
being called, even though scene view was freezed before.