Class

ARWorldTrackingConfiguration

A configuration that uses the back-facing camera, tracks a device's orientation and position, and detects real-world surfaces, and known images or objects.

Overview

All AR configurations establish a correspondence between the real world the device inhabits and a virtual 3D coordinate space where you can model content. When your app displays that content together with a live camera image, the user experiences the illusion that your virtual content is part of the real world.

Creating and maintaining this correspondence between spaces requires tracking the device's motion. The ARWorldTrackingConfiguration class tracks the device's movement with six degrees of freedom (6DOF): specifically, the three rotation axes (roll, pitch, and yaw), and three translation axes (movement in x, y, and z).

This kind of tracking can create immersive AR experiences: A virtual object can appear to stay in the same place relative to the real world, even as the user tilts the device to look above or below the object, or moves the device around to see the object's sides and back.

Figure 1

6DOF tracking maintains an AR illusion regardless of device rotation or movement

World-tracking sessions also provide several ways for your app to recognize or interact with elements of the real-world scene visible to the camera:

Topics

Creating a Configuration

init()

Initializes a new world tracking configuration.

var initialWorldMap: ARWorldMap?

The state from a previous AR session to attempt to resume with this session configuration.

Beta

Enabling Plane Detection

var planeDetection: ARWorldTrackingConfiguration.PlaneDetection

A value specifying whether and how the session attempts to automatically detect flat surfaces in the camera-captured image.

struct ARWorldTrackingConfiguration.PlaneDetection

Options for whether and how ARKit detects flat surfaces in captured images.

Enabling Image Detection and Tracking

var detectionImages: Set<ARReferenceImage>!

A set of images for ARKit to attempt to detect in the user's environment.

var maximumNumberOfTrackedImages: Int

The maximum number of detection images to simultaneously track movement for.

Beta

Enabling 3D Object Detection

class var isObjectDetectionSupported: Bool

A Boolean value that indicates whether the current device supports 3D object detection.

Beta
var detectionObjects: Set<ARReferenceObject>

A set of 3D objects for ARKit to attempt to detect in the user's environment.

Beta

Using Environment-Based Lighting

var environmentTexturing: ARWorldTrackingConfiguration.EnvironmentTexturing

The behavior ARKit uses for generating environment textures.

Beta
enum ARWorldTrackingConfiguration.EnvironmentTexturing

Options for generating environment textures in a world-tracking AR session.

Beta
class AREnvironmentProbeAnchor

An object that provides environmental lighting information for a specific area of space in a world-tracking AR session.

Beta

Managing Device Camera Behavior

var isAutoFocusEnabled: Bool

A Boolean value that determines whether the device camera uses fixed focus or autofocus behavior.

Relationships

Inherits From

Conforms To

See Also

World Tracking

Building Your First AR Experience

Create an app that runs an AR session and uses plane detection to place 3D content using SceneKit.

Understanding World Tracking in ARKit

Discover supporting concepts, features, and best practices for building great AR experiences.

class ARPlaneAnchor

Information about the position and orientation of a real-world flat surface detected in a world-tracking AR session.

class AREnvironmentProbeAnchor

An object that provides environmental lighting information for a specific area of space in a world-tracking AR session.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software