Canvatorium Visio Lab 5011
Loading a scene from Reality Composer Pro.
This loads a scene called *RocketPower* from the RealityKitContent package. I added a rocket from the Content Library and created a particle emitter. Coordinates in Immersive Spaces are relative to the user, so I had to move the model into view by adjusting the transform.
import SwiftUI
import RealityKit
import RealityKitContent
struct Lab5011: View {
var body: some View {
// Use Reality View to load a USDA file named RocketPower as an entity in RealityKit
RealityView { content in
if let scene = try? await Entity(named: "RocketPower", in: realityKitContentBundle) {
content.add(scene)
}
}
}
}