Closed Reality-Dev closed 1 year ago
From the Apple documentation on ARAnchorCopying:
ARAnchorCopying
Because anchor objects are immutable, ARKit must copy them to make changes from one ARFrame to the next.
Therefore, the transform values here in Satin are never getting updated (they stay the same):
fileprivate class ARObject: Object { … override func update(camera: Camera, viewport: simd_float4) { guard let anchor = anchor else { return } self.worldMatrix = anchor.transform super.update(camera: camera, viewport: viewport) }
ARKit appears to require us to use the ARSessionDelegate.session(_ session: ARSession, didUpdate anchors: [ARAnchor]) method to get updated transform values.
ARSessionDelegate.session(_ session: ARSession, didUpdate anchors: [ARAnchor])
Just fixed this commit: e43b50f980ef864ae4bf208afa4433a2f35afe91
From the Apple documentation on
ARAnchorCopying
:Therefore, the transform values here in Satin are never getting updated (they stay the same):
ARKit appears to require us to use the
ARSessionDelegate.session(_ session: ARSession, didUpdate anchors: [ARAnchor])
method to get updated transform values.