我正在使用SceneKit和ARKit。在委托方法中将调用以下函数:
func prepare(videoFrame: OTVideoFrame) {
let cameraNode = sceneView.scene.rootNode.childNodes.first {
$0.camera != nil
}
if let node = cameraNode, let cam = node.camera {
let data = Data(fromArray: [
node.simdPosition.x,
node.simdPosition.y,
node.simdPosition.z,
node.eulerAngles.x,
node.eulerAngles.y,
node.eulerAngles.z,
Float(cam.zNear),
Float(cam.fieldOfView)
])
var err: OTError?
videoFrame.setMetadata(data, error: &err)
if let e = err {
print("Error adding frame metadata: \(e.localizedDescription)")
}
}
}
我在node.simdPosition.x
行遇到以下错误:
'inout simd_float3' (aka 'inout float3') is not convertible to 'float3'
如何解决此错误?