问题
I am using Scene Kit and have created an SCNBox. On the front face of the box I want it so "A" happens if the left side of the front face gets clicked, and "B" happens if the right side of the front face gets clicked. How can I achieve this. I checked on stack but most answers cover if a node gets touched, not part of a node.
回答1:
SCNHitTestResult has a geometryIndex that will give you the index of the geometry element that was hit (i.e. the cube face). It also has a faceIndex property that will give you the index of the primitive in this element.
来源:https://stackoverflow.com/questions/36070840/determine-which-side-of-scnbox-got-touched-scene-kit-ios