raycast(from:allowing:alignment:)
Performs a ray cast, where a ray is cast into the scene from the center of the camera through a point in the view, and the results are immediately returned.
Declaration
@MainActor @preconcurrency func raycast(from point: CGPoint, allowing target: ARRaycastQuery.Target, alignment: ARRaycastQuery.TargetAlignment) -> [ARRaycastResult]Parameters
- point:
A point in the view’s local coordinate system.
- target:
The type of target where the ray should terminate.
- alignment:
The alignment of the target.
Return Value
A list of ray-cast results, sorted from nearest to farthest from the camera. The list is empty if the ray cast fails.