示例#1
0
        public void GetAnchors(List <NRWorldAnchor> anchorlist)
        {
            if (anchorlist == null)
            {
                Debug.LogError("Anchor list can not be null!");
                return;
            }
            anchorlist.Clear();

            var listhandle = NativeMapping.CreateAnchorList();
            var size       = NativeMapping.GetAnchorListSize(listhandle);

            for (int i = 0; i < size; i++)
            {
                var           anchorhandle = NativeMapping.AcquireItem(listhandle, i);
                NRWorldAnchor anchor       = null;
                m_AnchorDict.TryGetValue(anchorhandle, out anchor);
                if (anchor == null)
                {
                    anchor = CreateAnchor(anchorhandle);
                    m_AnchorDict.Add(anchorhandle, anchor);
                }
                anchorlist.Add(anchor);
            }
            anchorlist.AddRange(AnchorAddList);
            NativeMapping.DestroyAnchorList(listhandle);
        }
示例#2
0
 public void WriteWorldMap()
 {
     if (!Directory.Exists(MapOutPath))
     {
         Directory.CreateDirectory(MapOutPath);
     }
     NativeMapping.SaveMap(MapFilePath);
 }
示例#3
0
        public void AddAnchor(Pose worldPose)
        {
            var handle = NativeMapping.AddAnchor(worldPose);

            if (handle == 0)
            {
                Debug.LogError("Add anchor failed anchor handle:" + handle);
                return;
            }
            NRWorldAnchor anchor = null;

            m_AnchorDict.TryGetValue(handle, out anchor);
            if (anchor == null)
            {
                anchor = CreateAnchor(handle);
                m_AnchorDict.Add(handle, anchor);
            }
            AnchorAddList.Add(anchor);
        }
示例#4
0
 public void Create()
 {
     var result = NativeMapping.CreateDataBase();
 }
示例#5
0
 public NRWorldMap()
 {
     NativeMapping = new NativeMapping(NRSessionManager.Instance.NativeAPI);
 }
示例#6
0
 public void Destroy()
 {
     NativeMapping.DestroyDataBase();
 }
示例#7
0
 public void LoadWorldMap()
 {
     NativeMapping.LoadMap(MapFilePath);
 }
示例#8
0
 internal NRWorldAnchor(UInt64 trackableNativeHandle, NativeMapping nativeinterface)
 {
     AnchorNativeHandle = trackableNativeHandle;
     NativeInterface    = nativeinterface;
 }