Пример #1
0
    /// <summary>
    /// Loads 3D coordinates of features contained in the map
    /// </summary>
    public void loadMap(String mapPath)
    {
        clearMap();
        loadedFeatures = 0;
        totalFeatures  = MetaioSDKUnity.get3DPointsFrom3Dmap(Path.Combine(Application.streamingAssetsPath, mapPath), featuresRaw);
        Debug.Log(String.Format("Loaded map has {0} features", totalFeatures));

        map = new GameObject("Feature Map") as GameObject;
        map.AddComponent <EditorOnly>();
        map.tag = "EditorOnly"; // as set through editor
        metaioTracker[] trackers = (metaioTracker[])GameObject.FindObjectsOfType(typeof(metaioTracker));
        foreach (metaioTracker tracker in trackers)
        {
            if (tracker.cosID == 1)
            {
                map.transform.parent = tracker.transform;
                break;
            }
        }

        // we transform the map due to differences between Unity COS and metaio COS
        map.transform.eulerAngles = mapRotation;
        map.transform.localScale  = mapScale;

        Debug.Log("Start loading map... Don't delete Feature Map object while loading!");
    }
Пример #2
0
    /// <summary>
    /// Loads 3D coordinates of features contained in the map
    /// </summary>
    public void loadMap(String mapPath)
    {
        clearMap();
        loadedFeatures = 0;
        totalFeatures  = MetaioSDKUnity.get3DPointsFrom3Dmap(Application.dataPath + "\\StreamingAssets\\" + mapPath, featuresRaw);
        Debug.Log(String.Format("Loaded map has {0} features", totalFeatures));

        map = new GameObject("Feature Map") as GameObject;

        // we transform the map due to differences between Unity COS and metaio COS
        map.transform.eulerAngles = mapRotation;
        map.transform.localScale  = mapScale;

        Debug.Log("Start loading map... Don't delete Feature Map object while loading!");
    }