Information about a the result of a scene-space or view-space search for scene elements.
- iOS 8.0+
- macOS 10.8+
- tvOS 9.0+
- watchOS 2.0+
Hit-testing is the process of finding elements of a scene located at a specified point, or along a specified line segment (or ray). An
SCNHit object provides details about one result from a hit-test search. There are three ways to perform a hit-test search. Use the
hit method of an
SCNView object (or other scene renderer), the
hit method of a node, or the
ray method of your scene’s physics world.
When you perform a hit-test search, SceneKit looks for
SCNGeometry objects along the ray you specify. For each intersection between the ray and and a geometry, SceneKit creates a hit-test result to provide information about both the
SCNNode object containing the geometry and the location of the intersection on the geometry’s surface.