When i call queryDeviceAnchor in my Billboard system I get transform updates but I'm unsure how to process them (similar to the Diorama sample app).
Is it a bug that I recieve these updates? The documentation says that ARKit data is only provided in a full space so I would expect this not to work at all.
But if this is the case, why am I getting deviceAnchor values in this situation?
Post
Replies
Boosts
Views
Activity
It appears as if custom fonts don't work in SwiftUI ViewAttachments on visionOS? I can confirm that the fonts work in other parts of the app that aren't inside attachments.
Is this a know bug or is there a funamental misunderstanding on my part?
In the screenshot I've attached below I would expect the blue box to be perpendicular to the floor. It is the yAxisEntity in my code which I instatniate with a mesh of height 3. Instead it runs parallel to the floor what I'd expect to the z axis.
Here is my code
struct ImmerisveContentDebugView: View {
@Environment(ViewModel.self) private var model
@State var wallAnchor: AnchorEntity = {
return AnchorEntity(.plane(.vertical, classification: .wall, minimumBounds: SIMD2<Float>(0.1, 0.1)))
}()
@State var originEntity: Entity = {
let originMesh = MeshResource.generateSphere(radius: 0.2)
return ModelEntity(mesh: originMesh, materials: [SimpleMaterial(color: .orange, isMetallic: false)])
}()
@State var xAxisEntity: Entity = {
let line = MeshResource.generateBox(width: 3, height: 0.1, depth: 0.1)
return ModelEntity(mesh: line, materials: [SimpleMaterial(color: .red, isMetallic: false)])
}()
@State var yAxisEntity: Entity = {
let line = MeshResource.generateBox(width: 0.1, height: 3, depth: 0.1)
return ModelEntity(mesh: line, materials: [SimpleMaterial(color: .blue, isMetallic: false)])
}()
@State var zAxisEntity: Entity = {
let line = MeshResource.generateBox(width: 0.1, height: 0.1, depth: 3)
return ModelEntity(mesh: line, materials: [SimpleMaterial(color: .green, isMetallic: false)])
}()
var body: some View {
RealityView { content in
content.add(wallAnchor)
wallAnchor.addChild(originEntity)
wallAnchor.addChild(xAxisEntity)
wallAnchor.addChild(yAxisEntity)
wallAnchor.addChild(zAxisEntity)
}
}
}
And here is what the simualtor renders
I have an app that launches into an immersive space with a mixed immersion style.
It appears like the Reality View has bounds that resemble a window. I would expect the bounds to not exist because it's an ImmersiveSpace.
Why do they exist? And how can I remove these?
This is the entire code:
@main
struct RealityKitDebugViewApp: App {
var body: some Scene {
ImmersiveSpace {
ContentView()
}
}
}
struct ContentView: View {
@State var logMessages = [String]()
var body: some View {
RealityView { content, attachements in
let root = Entity()
content.add(root)
guard let debugView = attachements.entity(for: "entity_debug_view") else { return }
debugView.position = [0, 0, 0]
root.addChild(debugView)
} update: { content, attachements in
} attachments: {
Color.blue
.tag("entity_debug_view")
}
.onAppear(perform: {
self.logMessages.append("Hello World")
})
}
}
As the title says. I don't believe this was covered in the Unity sessions and I can't find documentation.