Post

Replies

Boosts

Views

Activity

RealityKit - Shadows on placement of AnchorEntity
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!
1
0
2.6k
May ’22
Accessing Resources of other package targets or dependencies using Swift Package Manager
Good day I am developing XRKit framework, which contains the pipeline logic for rendering using Metal, in manifest it has two targets - framework itself in Swift and XRKitDefenitions in C++ and MSL (since Apple forbids us multilingualism in one package). Both targets have Resources folders open in their manifest. When I try to access the test files hello01.txt (Resources for XRKit) and hello2.txt (Resources for XRKitDefenitions) via Bundle.module, I only see hello01.txt and it doesn't read hello2.txt because it's in a different target. How do I properly organize my code with SPM to access the Resources of XRKitDefenitions target? PS When trying to organize XRKitDefenitions as a remote package on GitHub and defining it as a dependency, situation does not change. I understand now that Bundle.module only refers to its Resources. Is there a way to refer to resources that provided other targets or dependencies in the same package?
1
1
2.5k
May ’22
RealityKit - Shadows on placement of AnchorEntity
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!
Replies
1
Boosts
0
Views
2.6k
Activity
May ’22
Accessing Resources of other package targets or dependencies using Swift Package Manager
Good day I am developing XRKit framework, which contains the pipeline logic for rendering using Metal, in manifest it has two targets - framework itself in Swift and XRKitDefenitions in C++ and MSL (since Apple forbids us multilingualism in one package). Both targets have Resources folders open in their manifest. When I try to access the test files hello01.txt (Resources for XRKit) and hello2.txt (Resources for XRKitDefenitions) via Bundle.module, I only see hello01.txt and it doesn't read hello2.txt because it's in a different target. How do I properly organize my code with SPM to access the Resources of XRKitDefenitions target? PS When trying to organize XRKitDefenitions as a remote package on GitHub and defining it as a dependency, situation does not change. I understand now that Bundle.module only refers to its Resources. Is there a way to refer to resources that provided other targets or dependencies in the same package?
Replies
1
Boosts
1
Views
2.5k
Activity
May ’22