A real-world position and orientation that can be used for placing objects in an AR scene.
真實世界的位置和方向,可用于將對象放置在AR場景中。
Overview
To track the positions and orientations of real or virtual objects relative to the camera, create anchor objects and use the?addAnchor:?method to add them to your AR session.
ARKit also automatically adds anchors when you enable the?planeDetection?option in a world tracking session
概述
要跟蹤真實或虛擬對象相對于相機的位置和方向,請創建錨點對象并使用addAnchor:方法將它們添加到AR會話中。
在世界跟蹤會話中啟用planeDetection選項時,ARKit還會自動添加錨點
? ? ? ? ? ? ? ? ? ? Creating Custom Anchors
-?initWithTransform:
Creates a new anchor object with the specified transform.
用指定的變換創建一個新的錨點對象。
Parameters
transform
A matrix encoding the position, orientation, and scale of the anchor relative to the world coordinate space of the AR session the anchor is placed in.?
World coordinate space in ARKit always follows a right-handed convention, but is oriented based on the session configuration. For details, see?About Augmented Reality and ARKit.
Discussion
Use the?addAnchor:?method to begin tracking your custom anchor in an AR session.
參數
transform
一個矩陣,用于編碼錨點相對于AR Session的世界坐標空間的位置,方向和比例尺。
ARKit中的世界坐標空間總是遵循右手慣例,但是基于會話配置而定向。 有關詳細信息,請參閱關于增強現實和ARKit。
討論
使用addAnchor:方法開始在AR Session中跟蹤自定義錨點。
? ? ? ? ? ? ? ? ? ? ? ? ? ? Tracking Anchors
identifier
A unique identifier for the anchor.
錨點的唯一標識符。
Discussion
Whether an anchor is created manually (with the?initWithTransform:?initializer) or automatically by ARKit (and provided to you through?ARSessionDelegate,?ARSCNViewDelegate, or?ARSKViewDelegate?methods), each anchor automatically receives a unique identifier value.
You can use this value to determine which anchors accompanying a specific?ARFrame?capture correspond to anchors in frames captured previously.
討論
無論是手動創建一個錨點(使用initWithTransform:初始化程序),還是由ARKit自動創建(并通過ARSessionDelegate,ARSCNViewDelegate或ARSKViewDelegate方法提供給您),每個錨點都會自動接收唯一的標識符值。
您可以使用此值來確定伴隨特定ARFrame捕獲的錨點對應于之前捕獲的幀中的錨點。
transform
A matrix encoding the position, orientation, and scale of the anchor relative to the world coordinate space of the AR session the anchor is placed in.
一個矩陣,用于編碼錨點相對于AR Session的世界坐標空間的位置,方向和比例尺。
Discussion
World coordinate space in ARKit always follows a right-handed convention, but is oriented based on the session configuration. For details, see?About Augmented Reality and ARKit.
討論
ARKit中的世界坐標空間總是遵循右手慣例,但是基于會話配置而定向。 有關詳細信息,請參閱關于增強現實和ARKit。
Inherits From?NSObject
Conforms To?NSCopying,?NSSecureCoding