Post

Replies

Boosts

Views

Activity

how to add entities to a volume or immersive view programmatically?
I have created two scenes, one immersive and one volumetric using Reality Composer Pro. In my test app I can view both and they render correctly. However, I would like to add entities programmatically. I am trying this; var body: some View { RealityView { content in if let scene = try? await Entity(named: "Scene", in: realityKitContentBundle) { viewModel.rootEntity = scene content.add(scene) var anchorEntity = AnchorEntity(world: [0, 0, -0.5]) let sphere = MeshResource.generateSphere(radius: 2.0) let material = SimpleMaterial(color: .red, roughness: 0.5, isMetallic: true) let modelEntity = ModelEntity(mesh: sphere, materials: [material]) anchorEntity.addChild(modelEntity) content.add(anchorEntity) } } } However, the sphere does not appear in the volume. I also tried it in the immersive space and it does not appear there either. What am I missing?
1
0
285
Oct ’24
NSTableView in view controller problem
I have a view controller which displays an NSTableView showing a list of names. I create two instances of this view controller in subviews in two different windows. In one window the view controller works fine, in the second it does not! In the second, the initial load of data works, but when the scroller is moved, the delegate is not called and no new data is displayed (blanks instead). Also, no clicks in the table are recognized in the VC! Below are screen caps of the two windows side by side. The first shows initial loading which is correct. In the second window I have clicked once in the scroll bar. Identical code!
2
0
1.4k
Jan ’22