Post marked as solved
Post marked as solved with 1 replies, 845 views
Hello!
When I expand the AnchorEntity in the following way, I see a shadow falling from the object:
let anchorEntity = AnchorEntity (plane: .any)
anchorEntity.addChild (parentEntity)
but in my scenario it is necessary to work with ARAnchors in the session (I am implementing a multi-user session and it is necessary to operate on CollaborationData, which, as I understand it, is currently impossible without binding to ARAnchors) and I am trying to write the code like this:
let anchorEntity = AnchorEntity (plane: .any)
anchorEntity.anchoring = AnchoringComponent (anchor)
anchorEntity.addChild (parentEntity)
or easier
let anchorEntity = AnchorEntity (anchor: anchor)
anchorEntity.addChild (parentEntity)
then there is no shadow from the placed object.
I figured that the bottom of my object (AnchorEntity) could be placed below the level of the detected flatness and tried to add a few centimeters on the Y axis when calculating the placement point:
let newTranslate = SIMD4 <Float> (x: transform.columns.3.x, y: transform.columns.3.y + 0.10, z: transform.columns.3.z, w: transform.columns.3.w)
let anchorTransform = simd_float4x4 (columns: (transform.columns.0, transform.columns.1, transform.columns.2, newTranslate))
let anchor = ARAnchor(name: arAnchorName, transform: anchorTransform)
self.arSession.add(anchor: anchor)
This actually lifts my model up 10 centimeters when placed, but there is still no shadow.
Thanks for any help!