Class

ARWorldTrackingConfiguration

A configuration that monitors the iOS device's position and orientation while enabling you to augment the environment that's in front of the user.

Declaration

@interface ARWorldTrackingConfiguration : ARConfiguration

Overview

All AR configurations establish a correspondence between the real world that the device inhabits and the virtual 3D-coordinate space, where you model content. When your app mixes virtual content 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): 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

Three illustrated variations of an iPhone running an app that displays an AR experience using the rear camera. The physical environment is depicted with a couch, in front of which, the app displays a virtual character. In the left picture, the iPhone views the couch straight on with the virtual character centered onscreen. In the middle picture, the device is rotated 30 degrees about the y-axis to the right, and the right-most portion of the couch and virtual character are visible onscreen only. In the right picture, the device is translated slightly to the left, and the left-most portions of the couch and virtual character are visible onscreen only.

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.

+ new

Creates a new world-tracking configuration.

initialWorldMap

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

Tracking Surfaces

planeDetection

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

ARPlaneDetection

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

sceneReconstruction

A flag that enables scene reconstruction.

+ supportsSceneReconstruction:

Checks if the device supports scene reconstruction.

Detecting or Tracking Images

detectionImages

A set of images that ARKit attempts to detect in the user's environment.

maximumNumberOfTrackedImages

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

automaticImageScaleEstimationEnabled

A flag that instructs ARKit to estimate and set the scale of a detected or tracked image on your behalf.

Detecting 3D Objects

detectionObjects

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

Tracking the User's Face

userFaceTrackingEnabled

A flag that determines whether ARKit tracks the user's face in a world-tracking session.

supportsUserFaceTracking

A Boolean value that tells you whether the iOS device supports tracking the user's face during a world-tracking session.

Creating Realistic Reflections

environmentTexturing

The behavior ARKit uses for generating environment textures.

AREnvironmentTexturing

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

AREnvironmentProbeAnchor

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

wantsHDREnvironmentTextures

A flag that instructs ARKit to create environment textures in HDR format.

Managing Device Camera Behavior

autoFocusEnabled

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

Enabling Collaboration

collaborationEnabled

A flag that opts you in to a peer-to-peer multiuser AR experience.

Relationships

Inherits From

See Also

Incorporating World Tracking

Understanding World Tracking

Discover features and best practices for building rear-camera AR experiences.