scaleDirection
TypeScriptget scaleDirection(): CameraFieldOfViewOrientationSwift declarationvar scaleDirection: CameraFieldOfViewOrientationThe direction in which the camera applies scaling.
struct · iOS 18.0+ · SDK 27.1
struct OrthographicCameraComponentA component that defines an orthographic virtual camera and its settings. Each scene requires a camera that defines the viewpoint from which RealityKit renders the scene. The orthographic camera renders the entities in the scene without the perspective of depth, meaning faraway objects don't look smaller. To create an orthographic camera, add this component to an entity. | **Perspective camera** | **Orthographic camera** | |:-:|:-:| |  |  | You can add an `OrthographicCameraComponent` to an entity's component set, and orient that entity so that it looks at a specific target using ``Entity/look(at:from:upVector:relativeTo:)``. ```swift // Create an entity to hold the camera component. let cameraEntity = Entity() // Create an orthographic camera component and add it to the camera entity. cameraEntity.components.set(OrthographicCameraComponent()) // Set the entity's position and orientation to look at the subject. let cameraPosition: SIMD3<Float> = [0, 1, 3] // The subject in this case is the origin. let target: SIMD3<Float> = .zero cameraEntity.look(at: target, from: cameraPosition, relativeTo: nil) // Add the camera entity to your scene. content.add(cameraEntity) ``` In AR scenarios, the system provides the camera automatically; however, in non-AR scenarios, the app needs to set the camera. If the app doesn't provide a camera, the system uses the default perspective camera.
get scaleDirection(): CameraFieldOfViewOrientationSwift declarationvar scaleDirection: CameraFieldOfViewOrientationThe direction in which the camera applies scaling.
set scaleDirection(value: CameraFieldOfViewOrientation)Swift declarationvar scaleDirection: CameraFieldOfViewOrientationThe direction in which the camera applies scaling.
get far(): numberSwift declarationvar far: FloatThe maximum distance in meters from the camera that the camera can see. The value defaults to `1000.0`. Use a value greater than the value of ``near``. The renderer clips any surface beyond the `far` point.
set far(value: number)Swift declarationvar far: FloatThe maximum distance in meters from the camera that the camera can see. The value defaults to `1000.0`. Use a value greater than the value of ``near``. The renderer clips any surface beyond the `far` point.
get near(): numberSwift declarationvar near: FloatThe minimum distance in meters from the camera that the camera can see. The value defaults to `1.0` centimeter. Use a value greater than `0.0` and less than the value of ``far``. The renderer clips any surface closer than the `near` point.
set near(value: number)Swift declarationvar near: FloatThe minimum distance in meters from the camera that the camera can see. The value defaults to `1.0` centimeter. Use a value greater than `0.0` and less than the value of ``far``. The renderer clips any surface closer than the `near` point.
get scale(): numberSwift declarationvar scale: FloatA floating-point value the camera uses to scale entities.
set scale(value: number)Swift declarationvar scale: FloatA floating-point value the camera uses to scale entities.
static init(): OrthographicCameraComponentSwift declarationinit()Creates an orthographic camera component with default values.
No declarations were skipped in this snapshot.