Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在对包含具有 SCNText 几何的 SCNNodes 的 ARSCNView 进行命中测试时,似乎只有当测试的点位于 SCNText 中的字母内时,命中测试才会成功。
这不是最优的,因为它使节点更难挖掘。如果测试点位于 SCNNode 范围内的任何位置,是否有办法更改“命中框”以便命中测试成功?如果用户的点击位于 SCNText 中的两个字母之间,我试图避免命中测试不成功的情况。
我通过将 SCNHitTestOption.boundingBoxOnly 选项设置为 true 解决了我的问题。这将忽略节点的几何形状进行命中测试。
let hitTestResults = sceneView.hitTest(tapPoint, options: [.boundingBoxOnly: true])