Contents

init(foveatedStreaming:content:)

Creates an immersive space to display foveated streaming content alongside RealityKit content.

Declaration

nonisolated init<V>(foveatedStreaming session: FoveatedStreamingSession, @ViewBuilder content: @escaping () -> V) where Content == ImmersiveSpaceViewContent<FoveatedStreamingSpaceContent>, Data == Never, V : View

Parameters

  • session:

    The foveated streaming session whose streamed content the space displays.

  • content:

    An immersive space content builder that defines the content of the space.

Discussion

You can add RealityKit content to your space that coexists alongside the streamed content, for example:

ImmersiveSpace(foveatedStreaming: session) {
    RealityView { content in
        // Add a sphere to the immersive space.
        let entity = ModelEntity(mesh: .generateSphere(radius: 0.1),
                         materials: [SimpleMaterial()])
        content.add(entity)
    }
}