I see example code converting the results of a SpatialTap to a SIMD3<Float> location. For example, from WWDC session Meet ARKit for spatial computing:
let location3D = value.convert(value.location3D, from: .global, to: .scene)
What I really want is a simd_float4x4 that includes orientation of the surface that the tap gesture/cast collided with?
My goal is to place an object with its Y-axis along the normal of the surface that was tapped.
For example, in the referenced WWDC session, they create a CollisionComponent from the MeshAnchor data. If that mesh data is covering a curved couch cushion, I would like the normal from that curved cushion (i.e., the closest triangle approximating it).
Is this possible?
My planned fallback is to only use planes for collision surfaces for tap gestures, extract the tap gesture value's entity (which I am hoping is the plane), and grab its transform for the orientation information.
I am hoping Apple has a simple function call that is more general than my fallback approach.