Class

PerspectiveCamera

A virtual camera that establishes the rendering perspective.

Declaration

class PerspectiveCamera : Entity

Overview

During an AR session, RealityKit automatically uses the device’s camera to define the perspective from which to render the scene. When rendering a scene outside of an AR session (with the view’s cameraMode property set to ARView.CameraMode.nonAR), RealityKit uses a PerspectiveCamera instead. You can add a perspective camera anywhere in your scene to control the point of view. If you don't explicitly provide one, RealityKit creates a default camera for you.

Topics

Creating a Camera

init()

Creates a perspective camera entity.

func clone(recursive: Bool) -> Self

Duplicates a perspective camera entity to create a new perspective camera entity.

Identifying a Camera

var id: ObjectIdentifier

The stable identity of the entity associated with self.

var id: UInt64

The stable identity of the camera.

typealias PerspectiveCamera.ID

A type of unique identifier used for a camera.

Configuring the Camera

var camera: PerspectiveCameraComponent

A camera component for the perspective camera entity.

struct PerspectiveCameraComponent

A component that defines a virtual camera and its controls.

protocol HasPerspectiveCamera

An interface that enables you to configure a virtual camera that you can use to define the rendering perspective when you’re not in an AR session.

Loading a Stored Entity

Stored Entities

Manage entities stored as assets on disk.

Positioning Entities in Space

Finding the Nearest Anchor

Calculating the Collision Shape

Describing the Camera

See Also

Cameras and Lighting

class PointLight

An entity that produces an omnidirectional light for virtual objects.

class DirectionalLight

An entity that casts a virtual light in a particular direction.

class SpotLight

An entity that illuminates virtual content in a cone-shaped volume.