.scn 包含平面对象的文件。我知道如何将其放置在相机所在的位置,但如何获得到最近表面的距离。
.scn
抱歉,如果这听起来像是一个代码请求,但我不知道从哪里开始,任何指导将不胜感激
您可以使用 hitTest https://developer.apple.com/documentation/arkit/arhittestresult
for result in sceneView.hitTest(CGPoint(x: 0.5, y: 0.5), types: [.existingPlaneUsingExtent, .featurePoint]) { print(result.distance, result.worldTransform) }