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?
Post
Replies
Boosts
Views
Activity
I design a scene in Reality Composer, design triggers, events and actions. I save the scene as a *.rcproject file and export it as a *.reality file.
In Xode, it turns out to load the file as shown here https://developer.apple.com/documentation/realitykit/creating_3d_content_with_reality_composer/loading_reality_composer_files_manually_without_generated_code, post it as Entity in ARSession. Everything works perfectly according to the designed logic (by tapping on the screen, the billiard ball starts moving and knocks down the pins).
My questions:
How do I access the Xcode triggers that I have designed in Reality Composer from code? No, the generated code is not here for me? Can I upload the .*reality file only as an Entity?
If I cannot work with the .*reality file as I suppose, can I not physically add the *.rcproject file to the project, but load the file from an external source, thereby gaining access to the generated code and event triggers?
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!