A real-world position and orientation that can be used for placing objects in an AR scene.
- iOS 11.0+
To track the static positions and orientations of real or virtual objects relative to the camera, create anchor objects and use the
add method to add them to your AR session.
Some ARKit features automatically add special anchors to a session. World-tracking sessions can add
ARImage objects if you enable the corresponding features; face-tracking sessions add
In addition to creating your own
ARAnchor instances to track the real-world positions of your virtual content, you can also subclass
ARAnchor to associate custom data with anchors you create. Ensure that your anchor classes behave correctly when ARKit updates frames or saves and loads anchors in an
Anchor subclasses must fullfill the requirements of the
initto copy, save, and restore the values of any custom properties your subclass adds.
ARAnchoris an immutable object representing the current state of an anchor in a specific frame; when an anchor is present in more than one
ARFrame, ARKit copies the
ARAnchorinstance on a background thread.
Anchors are considered equal based on their
Only anchors that do not conform to
ARTrackableare included when you save a world map.