Information about a real-world surface found by examining a point in the device camera view of an AR session.
- iOS 11.0+
If you display an AR experience using SceneKit or SpriteKit, you can use one of the following methods to search the camera image for real-world content at a point specified in view coordinates:
Otherwise, you can search the camera image for real-world content using the
hit method. Because a frame is independent of a view, for this method you pass a point specified in normalized image coordinates (where
(0,0) is the top left corner of the image and
(1,1) is the lower right).
All these methods return an array of
ARHit objects describing the content found. The number and order of results in the array depends on the search types you specify and the order you specify them in. For example, consider the code below:
hit call searches first for plane anchors already present in the session (according to the session configuration's
plane settings); returning any such results (in order of distance from the camera) as the first elements in the array. This call also (due to the estimatedHorizontalPlane request) attempts to determine whether the hit test ray intersects any horizontal surface not already found by plane detection, and returns that result (if any) as the last element in the array.