I’ve searched all over the docs and might simply be missing something very big. Is raycasting available on front-facing True Depth cameras like on the iPad Pro?
I’m working on an application currently where I’m in ARFaceTrackingConfiguration and a simple raycast from the screen center is not yielding results.
That same code in World configuration using the rear camera is producing results. This code is straight from the docs.
let raycastQuery: ARRaycastQuery? = sceneView.raycastQuery(
from: sceneView.center,
allowing: .estimatedPlane,
alignment: .any)
let rayresults: [ARRaycastResult] = sceneView.session.raycast(raycastQuery!)
print(rayresults)
My understanding, given the examples around face tracking depth maps for background blur, was that the front camera would have essentially the same depth data as the rear, just with less total depth distance available.
Since this code returns a result set on the Rear Camera but does not return results on the Front Camera, I’m wondering if it is because of the direction of the ray? For the Front Camera, if rayCast is supported, maybe it requires the ray to be cast in the negative z direction? But I haven’t had success there.
The goal of the project is to be able to get the distance between 2 points in 3D space but with the front camera not the rear.
Thanks for setting me straight! I appreciate it.




