I have a plane AnchorEntity with a child raycast AnchorEntity and my ObjectEntities (USDZ & Mesh) as children of that.
On devices up to iOS 14 I get grounding shadows, but on iOS 15 these don't appear.
My testing shows that grounding shadows will only appear on iOS 15 if I add ObjectEntities directly as children of the plane?
Is there some way in iOS 15 to get grounding shadows to pass through the intermediate raycast AnchorEntity to the plane underneath as they do in iOS14?
Thanks.
Here's my test code:
let query = arView.makeRaycastQuery(from: arView.center, allowing: .estimatedPlane, alignment: .horizontal)
let result = arView.session.raycast(query).first
let raycastAnchor = AnchorEntity(raycastResult: result)
let planeAnchor = AnchorEntity(plane: .horizontal, classification: .any, minimumBounds: [0.2, 0.2])
let robot = (try? AnchorEntity.loadModel(named: "robot", in: nil))
// ** This gives Grounding Shadow on iOS 14 but not iOS 15
planeAnchor.addChild(raycastAnchor)
raycastAnchor.addChild(robot!)
arView.scene.anchors.append(planeAnchor)
// ** This gives Grounding Shadow on both iOS 14 and 15
raycastAnchor.addChild(planeAnchor)
planeAnchor.addChild(robot!)
arView.scene.anchors.append(raycastAnchor)