Post

Replies

Boosts

Views

Activity

Reply to visionOS - AR Passthrough in Immersive Mode?
From my understanding you want to still see the room while an Immersive Space space is active? For that, you can simply set the immersionStyle selection to .mixed, from where you register the ImmersiveSpace in your @main app body. Here's an example I have: ImmersiveSpace(id: "ImmersiveView") { ImmersiveView(viewModel: viewModel) }.immersionStyle(selection: .constant(.mixed), in: .mixed) https://developer.apple.com/documentation/swiftui/immersionstyle
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’23
Reply to How can I swap materials on a specific object within a scene loaded from realitykit? I want to have 4-6 materials to be able to select from and swap out on an object.
In your main view you can use SwiftUI to add buttons to allow the user to tap and change the current material. You can set that selected material onto a ViewModel object, or have the button actions trigger a function on the ViewModel. Present an ImmersiveSpace and use the same ViewModel object over there. Add your desired ModelEntity to the RealityView of the ImmersiveSpace. Make a reference to that ModelEntity in your ViewModel. Back in your SwiftUI View and ViewModel, make your button actions modify the .material of the ModelEntity previously added. Now, you have a SwiftUI view with button actions hooked up to the same ViewModel that has a reference to the ModelEntity.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Reply to Fluid in ARKit or SceneKit
I think this project in particular was not done natively - it was done in Unity.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to App Crash during toggle between Speaker to bluetooth headphone.
I am working on an application that uses RealityKit and AVAudioSession for audio calls, and I too am having the same owningEngine == nil crash. It has been a nightmare for a few months now...
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Replace model static entity onto animated model without losing animations / Multiple animations for dynamic assets
Is it possible to use animations from one model to play on a different model with same skeleton? I know this is possible in SceneKit AR implementation, but I am having a lot of problems doing this in RealityKit. Thanks for any advice.
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to visionOS - AR Passthrough in Immersive Mode?
From my understanding you want to still see the room while an Immersive Space space is active? For that, you can simply set the immersionStyle selection to .mixed, from where you register the ImmersiveSpace in your @main app body. Here's an example I have: ImmersiveSpace(id: "ImmersiveView") { ImmersiveView(viewModel: viewModel) }.immersionStyle(selection: .constant(.mixed), in: .mixed) https://developer.apple.com/documentation/swiftui/immersionstyle
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to visionOS Window launch size
WindowGroup { .......... }.defaultSize(CGSize(width: 700, height: 700))
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to visionOS: importing USDZ file
Model3D("filename")
Replies
Boosts
Views
Activity
Oct ’23
Reply to How can I swap materials on a specific object within a scene loaded from realitykit? I want to have 4-6 materials to be able to select from and swap out on an object.
In your main view you can use SwiftUI to add buttons to allow the user to tap and change the current material. You can set that selected material onto a ViewModel object, or have the button actions trigger a function on the ViewModel. Present an ImmersiveSpace and use the same ViewModel object over there. Add your desired ModelEntity to the RealityView of the ImmersiveSpace. Make a reference to that ModelEntity in your ViewModel. Back in your SwiftUI View and ViewModel, make your button actions modify the .material of the ModelEntity previously added. Now, you have a SwiftUI view with button actions hooked up to the same ViewModel that has a reference to the ModelEntity.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to How to set a size for an entity that is composed by a 3d model?
// scale model to 50% entity.scale = .init(repeating: 0.5)
Topic: Graphics & Games SubTopic: RealityKit Tags:
Replies
Boosts
Views
Activity
Oct ’23