public override void DestroyAnchor(ARKAnchor _anchor) { if (string.IsNullOrEmpty(_anchor.id)) { return; } NativeInterface.RemoveUserAnchor(_anchor.id); if (m_anchors.ContainsKey(_anchor.id)) { m_anchors.Remove(_anchor.id); } _anchor.id = null; }
public override void ApplyAnchor(ARKAnchor _anchor) { if (!IsRunning) { return; } Transform t = _anchor.transform; Matrix4x4 matrix = Matrix4x4.TRS(t.position, t.rotation, t.localScale); var anchorData = new UnityARUserAnchorData(); anchorData.transform.column0 = matrix.GetColumn(0); anchorData.transform.column1 = matrix.GetColumn(1); anchorData.transform.column2 = matrix.GetColumn(2); anchorData.transform.column3 = matrix.GetColumn(3); anchorData = NativeInterface.AddUserAnchor(anchorData); _anchor.id = anchorData.identifierStr; m_anchors[_anchor.id] = _anchor; }
/// <summary> /// Destroys the specified Anchor. /// </summary> public virtual void DestroyAnchor(ARKAnchor _anchor) { }
/// <summary> /// Adds an Anchor to the world. /// </summary> public virtual void ApplyAnchor(ARKAnchor _anchor) { }