createAnchor
Declaration
func createAnchor(at pose: simd_float4x4) throws -> NSDKVpsAnchorId
Summary
Returns
A unique identifier for the created anchor.
Throws
NSDKError.invalidOperationif the localization is not in.precisestate.
Notice
Attention: Anchors can only be created when the current localization's tracking state is .precise. Use $latestLocalization to observe tracking state.
Parameters
| Name | Type | Summary |
|---|---|---|
| pose | simd_float4x4 | The 4x4 transformation matrix representing the anchor's position and orientation in ARKit space. |
Requests to create an anchor at the specified pose.
Creates an anchor relative to the currently tracked location, and begins tracking (no
need to call
trackAnchor(payload:)). The payload for the new anchor will not beavailable immediately — the session polls for it each frame and fires
createdAnchorPayloadonce it becomes ready.Anchors mark a place in the world that content should stay attached to. VPS2 must
localize to a map before anchors can be created for it: use
localize(siteId:)orlocalize(latitude:longitude:radiusMeters:). An anchor created here will only trackwith the asset of the site that was active at the time of its creation.