gpt4 book ai didi

ios - ARKit 中访问节点名称

转载 作者:行者123 更新时间:2023-11-30 11:50:10 39 4
gpt4 key购买 nike

我正在尝试从以下内容中检索 string=Gate。

<SCNHitTestResult: 0x1c4016dc0 <0.167996,0.067400,-0.095000> | geometryIndex=0 node=<SCNNode: 0x1c43e1100 'test' pos(0.000000 0.000000 -0.100000) scale(0.010000 0.010000 0.010000) | geometry=<SCNText: 0x1c43e0e00 | 3 elements | string=Gate extrusionDepth=1.000>  | no child> bone=(null)>

MyCode 访问几何并且工作正常,如下

let hitResults: [SCNHitTestResult] = sceneView.hitTest(location, options: hitTestOptions)
if let hit = hitResults.first {
print(hit.node.geometry)
}

I already have tried this hit.node.geometry?.name but this returns nil

最佳答案

我刚刚解决了这个问题

node.name = "test"
if(hit.node.name == "test") { // Do Something }

关于ios - ARKit 中访问节点名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48414093/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com