public JObject GetCurrentPlaneList()
        {
            LinkedList <ARPlaneAnchorGameObject> list = placenoteARAnchorManager.GetCurrentPlaneAnchors();
            PlaneMeshList saveList = new PlaneMeshList();

            saveList.meshList = new ARPlaneMesh[list.Count];
            int planeNum = 0;

            Debug.Log("Creating list of + " + list.Count.ToString() + " planes");

            foreach (var plane in list)
            {
                ARPlaneMesh planeSaved = new ARPlaneMesh();

                planeSaved.transform = plane.planeAnchor.transform;
                planeSaved.center    = plane.planeAnchor.center;
                planeSaved.extent    = plane.planeAnchor.extent;

                if (UnityARSessionNativeInterface.IsARKit_1_5_Supported())
                {
                    planeSaved.vertices         = plane.planeAnchor.planeGeometry.vertices;
                    planeSaved.texture          = plane.planeAnchor.planeGeometry.textureCoordinates;
                    planeSaved.trIndices        = plane.planeAnchor.planeGeometry.triangleIndices;
                    planeSaved.boundaryVertices = plane.planeAnchor.planeGeometry.boundaryVertices;
                }
                planeSaved.id = plane.planeAnchor.identifier;
                saveList.meshList [planeNum] = planeSaved;
                planeNum++;
            }

            return(JObject.FromObject(saveList));
        }
Ejemplo n.º 2
0
        // Use this for initialization
        public void StartPlaneDetection()
        {
            if (UnityARSessionNativeInterface.IsARKit_1_5_Supported())
            {
                PlacenotePlaneUtility.InitializePlanePrefab(meshPrefab);
            }
            else
            {
                PlacenotePlaneUtility.InitializePlanePrefab(planePrefab);
            }

            placenoteARAnchorManager = new PlacenoteARAnchorManager();
        }
        // Use this for initialization
        void Start()
        {
            placenoteARAnchorManager = new PlacenoteARAnchorManager();
            loadedPlaneList          = new LinkedList <GameObject> ();

            if (UnityARSessionNativeInterface.IsARKit_1_5_Supported())
            {
                PlacenotePlaneUtility.InitializePlanePrefab(meshPrefab);
            }
            else
            {
                PlacenotePlaneUtility.InitializePlanePrefab(planePrefab);
            }
        }