Is it possible to retrieve the position and orientation of a window that is opened in an immersive space?
The following code:
struct MyWindow: View {
var body: some View {
VStack {
Text("Hello")
}
.onGeometryChange3D(for: Point3D.self) { proxy in try! proxy
.coordinateSpace3D()
.convert(value: Point3D.zero, to: .worldReference)
}
action : { point in
print(point)
}
}
}
seems to work for the position, but I also need the orientation.