Posts

Post marked as solved
2 Replies
The below code worked,return sphHar.withUnsafeBytes { rawBytes -> [Float32] in return [Float32](rawBytes.bindMemory(to: Float32.self)) }
Post marked as solved
2 Replies
I am not sure if it is a byte concatenating issue since I am able to generate and store 13 Float elements (52 bytes) in the array. It is only when I am trying to generate the next array element that I get this issue. Please let me know if this is the right way to read the elements of the "Data" object or I am doing something fundamentally wrong?
Post marked as solved
2 Replies
Thanks for the suggestion @gchiste _/\_. It helped to to arrive at correct solution using ARSCNViewDelegateI use the below code snippet to retrieve the directional light estimateextension MyViewController: ARSCNViewDelegate { func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { DispatchQueue.global(qos: .default).async { guard let frame = self.specScnView.session.currentFrame else { return } if frame.lightEstimate is ARDirectionalLightEstimate { self.dirLightEst = frame.lightEstimate as? ARDirectionalLightEstimate } } }