activeCamera
TypeScriptget activeCamera(): (Entity) | nullSwift declarationvar activeCamera: Entity? { get set }The camera to be used for rendering.
class · iOS 18.0+ · SDK 27.1
class RealityRendererA renderer that displays a RealityKit scene in an existing Metal workflow. All RealityKit APIs for loading resources, creating entities and adding components are compatible and work with `RealityRenderer`.
get activeCamera(): (Entity) | nullSwift declarationvar activeCamera: Entity? { get set }The camera to be used for rendering.
set activeCamera(value: (Entity) | null)Swift declarationvar activeCamera: Entity? { get set }The camera to be used for rendering.
get audioListener(): (Entity) | nullSwift declarationvar audioListener: Entity? { get set }The entity which defines the listener position and orientation for spatial audio. By default this `audioListener` property is nil, which means that the active camera entity will be used as the audio listener. The `audioListener` can be set to any entity in the `scene` to use the transform of the entity as the audio listener position and orientation.
set audioListener(value: (Entity) | null)Swift declarationvar audioListener: Entity? { get set }The entity which defines the listener position and orientation for spatial audio. By default this `audioListener` property is nil, which means that the active camera entity will be used as the audio listener. The `audioListener` can be set to any entity in the `scene` to use the transform of the entity as the audio listener position and orientation.
get cameraSettings(): RealityRenderer_CameraSettingsSwift declarationvar cameraSettings: RealityRenderer.CameraSettingsThe settings to be used for rendering with `activeCamera`.
set cameraSettings(value: RealityRenderer_CameraSettings)Swift declarationvar cameraSettings: RealityRenderer.CameraSettingsThe settings to be used for rendering with `activeCamera`.
updateAndRender(deltaTime: number, cameraOutput: RealityRenderer_CameraOutput, whenScheduled?: (((arg0: RealityRenderer) => void)) | null, onComplete?: (((arg0: RealityRenderer) => void)) | null, actionsBeforeRender?: Array<RealityRenderer_MetalEventAction>, actionsAfterRender?: Array<RealityRenderer_MetalEventAction>): Promise<void>Swift declaration@MainActor @preconcurrency func updateAndRender(deltaTime: TimeInterval, cameraOutput: RealityRenderer.CameraOutput, whenScheduled: (@Sendable (RealityRenderer) -> Void)? = nil, onComplete: (@Sendable (RealityRenderer) -> Void)? = nil, actionsBeforeRender: [RealityRenderer.MetalEventAction] = [], actionsAfterRender: [RealityRenderer.MetalEventAction] = []) throwsTick the simulation and render using activeCamera and the camera rendering output. - Parameters: - deltaTime: The delta time to advance the simulation - cameraOutput: Specifies output for rendering with ``activeCamera`` - whenScheduled: A handler that is called when the corresponding MTLCommandBuffer is scheduled - onComplete: A handler that is called when the corresponding MTLCommandBuffer is complete - actionsBeforeRender: Array of events and values to wait before GPU rendering work - actionsAfterRender: Array of events and values to signal after GPU rendering work
get extendedDynamicRangeOutput(): booleanSwift declarationvar extendedDynamicRangeOutput: Bool { get set }Specify whether the target Metal layer has been configured for EDR output. If the Metal layer that this ``RealityRenderer`` will be rendering into has been configured to output extended dynamic range content (i.e. the property ``QuartzCore/CAMetalLayer/wantsExtendedDynamicRangeContent`` on the target ``QuartzCore/CAMetalLayer`` has been set to `true` and a pixel format that supports EDR content has been set), this property should be set to `true` so that ``RealityRenderer`` adjusts its tone mapping accordingly. To control the amount of headroom available for extended dynamic range content, see ``extendedDynamicRangeHeadroom``. The default value is `false`.
set extendedDynamicRangeOutput(value: boolean)Swift declarationvar extendedDynamicRangeOutput: Bool { get set }Specify whether the target Metal layer has been configured for EDR output. If the Metal layer that this ``RealityRenderer`` will be rendering into has been configured to output extended dynamic range content (i.e. the property ``QuartzCore/CAMetalLayer/wantsExtendedDynamicRangeContent`` on the target ``QuartzCore/CAMetalLayer`` has been set to `true` and a pixel format that supports EDR content has been set), this property should be set to `true` so that ``RealityRenderer`` adjusts its tone mapping accordingly. To control the amount of headroom available for extended dynamic range content, see ``extendedDynamicRangeHeadroom``. The default value is `false`.
get extendedDynamicRangeHeadroom(): numberSwift declarationvar extendedDynamicRangeHeadroom: Float { get set }The amount of headroom available for extended dynamic range content. When EDR output is enabled using ``extendedDynamicRangeOutput``, standard dynamic range values output by this ``RealityRenderer`` will be scaled such that there's some _headroom_ to display extended range values. This value is in the range `[1.0-16.0]`. The default value is `2.0`.
set extendedDynamicRangeHeadroom(value: number)Swift declarationvar extendedDynamicRangeHeadroom: Float { get set }The amount of headroom available for extended dynamic range content. When EDR output is enabled using ``extendedDynamicRangeOutput``, standard dynamic range values output by this ``RealityRenderer`` will be scaled such that there's some _headroom_ to display extended range values. This value is in the range `[1.0-16.0]`. The default value is `2.0`.
update(deltaTime: number): Promise<void>Swift declaration@MainActor func update(_ deltaTime: TimeInterval) throwsTick the simulation - Parameter deltaTime: The delta time to advance the simulation
get entities(): Promise<RealityRenderer_EntityCollection>Swift declaration@MainActor var entities: RealityRenderer.EntityCollection { get set }A collection of RealityKit entities that this renderer renders within the scene.
setEntities(value: RealityRenderer_EntityCollection): Promise<void>Swift declaration@MainActor var entities: RealityRenderer.EntityCollection { get set }A collection of RealityKit entities that this renderer renders within the scene.
get lighting(): Promise<RealityRenderer_ImageBasedLight>Swift declaration@MainActor var lighting: RealityRenderer.ImageBasedLight { get set }The lighting used in the environment of a particular scene.
setLighting(value: RealityRenderer_ImageBasedLight): Promise<void>Swift declaration@MainActor var lighting: RealityRenderer.ImageBasedLight { get set }The lighting used in the environment of a particular scene.
static init(): Promise<RealityRenderer>Swift declaration@MainActor init() throws1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
RealityRenderer.subscribe(to:on:componentType:_:)
Passing a Swift type itself is not supported.