如何将CGPoint转换为SCNVector3?
我想将UIView中的接触点转移到SceneView。但是如何?
我在论坛中找不到任何资源。
答案 0 :(得分:1)
只要看看您的SCNView类,其中就有很多多汁的东西。
/*!
@method hitTest:options:
@abstract Returns an array of SCNHitTestResult for each node that contains a specified point.
@param point A point in the coordinate system of the receiver.
@param options Optional parameters (see the "Hit test options" group for the available options).
*/
let hitResults:[SCNHitTestResult] = mySCNView.hitTest(point, options:[:])
https://developer.apple.com/documentation/scenekit/scnhittestresult
https://developer.apple.com/documentation/scenekit/scnhittestresult/1523058-worldcoordinates