trackedRaycast(from:allowing:alignment:updateHandler:)
Performs a tracked ray cast, where a ray is cast into the scene from the center of the camera through a point in the view.
Declaration
@MainActor @preconcurrency func trackedRaycast(from point: CGPoint, allowing target: ARRaycastQuery.Target, alignment: ARRaycastQuery.TargetAlignment, updateHandler: @escaping ([ARRaycastResult]) -> Void) -> ARTrackedRaycast?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.
- updateHandler:
A closure the method calls to update the list of results, sorted from nearest to farthest from the camera. The closure is called on the Session instance’s delegate queue.
Return Value
A tracked ray-cast instance used to update or stop ray casting. The result is nil if the ray cast fails or if the AR session configuration isn’t ARWorldTrackingConfiguration or one of its subclasses.