diff --git a/README.md b/README.md index 24c42512f09dbaf373c66e17650e1654a421867f..237c53b124dccde3b01ddf4b0c4e45fef83b6788 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ https://developer.apple.com/documentation/arkit/arworldmap The .map file can be placed in the Unity persistent data path of the application on the user device with the following name: "ARkitWorlMap.map". Alternatively, the variable keyvalueTags of the Trackable can also contain a parameter with the "url" key providing a link to download the map file. -By default, the origin of the Map Trackable is the point (0, 0 ,0). If the Map includes an Anchor, you can use it as the origin by setting the name of the Trackable in the World Storage with the TrackableId of the ARAnchor stored in the map. https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/api/UnityEngine.XR.ARSubsystems.TrackableId.html +The map needs to include at least one Anchor. You can use one of them as the origin of the map by setting the name of the Trackable in the World Storage with the TrackableId of the ARAnchor stored in the map. https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.1/api/UnityEngine.XR.ARSubsystems.TrackableId.html Samples for creating and serializing an ARWorldMap with ARFoundation can be found here: https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/Runtime/ARWorldMapController.cs diff --git a/Runtime/Scripts/WorldAnalysisARFoundation.cs b/Runtime/Scripts/WorldAnalysisARFoundation.cs index 34925a2b6a8e50d09128bcf3c3479240bae7a522..97f94a97814f96adcbb858b3f74f5870a1bb0bfe 100644 --- a/Runtime/Scripts/WorldAnalysisARFoundation.cs +++ b/Runtime/Scripts/WorldAnalysisARFoundation.cs @@ -84,8 +84,6 @@ public class WorldAnalysisARFoundation : MonoBehaviour, WorldAnalysisInterface WorldAnalysisARFoundationModuleImage imageModule = new WorldAnalysisARFoundationModuleImage(); m_trackableModules.Add(imageModule); - WorldAnalysisARFoundationModuleGeospatial geospatialModule = new WorldAnalysisARFoundationModuleGeospatial(); - m_trackableModules.Add(geospatialModule); #if UNITY_IOS WorldAnalysisARFoundationModuleMesh meshModule = new WorldAnalysisARFoundationModuleMesh(); m_trackableModules.Add(meshModule); @@ -98,6 +96,8 @@ public class WorldAnalysisARFoundation : MonoBehaviour, WorldAnalysisInterface // todo add script define symbol for using arcore extensions WorldAnalysisARFoundationModuleARCoreAnchor arCoreAnchorModule = new WorldAnalysisARFoundationModuleARCoreAnchor(); m_trackableModules.Add(arCoreAnchorModule); + WorldAnalysisARFoundationModuleGeospatial geospatialModule = new WorldAnalysisARFoundationModuleGeospatial(); + m_trackableModules.Add(geospatialModule); #else /// on other os : if arcore extensions is in the scene we disable it Google.XR.ARCoreExtensions.ARCoreExtensions arCoreExtensions = Component.FindObjectOfType<Google.XR.ARCoreExtensions.ARCoreExtensions>(); diff --git a/Runtime/Scripts/WorldAnalysisARFoundationModuleARKitWorldMap.cs b/Runtime/Scripts/WorldAnalysisARFoundationModuleARKitWorldMap.cs index 5b1ef2042b46b360f4d720e7a9972e07d5ad94c8..7019f3a9ca0a193427f4217de0e56e17d5eb1644 100644 --- a/Runtime/Scripts/WorldAnalysisARFoundationModuleARKitWorldMap.cs +++ b/Runtime/Scripts/WorldAnalysisARFoundationModuleARKitWorldMap.cs @@ -231,7 +231,7 @@ public class WorldAnalysisARFoundationModuleARKitWorldMap : WorldAnalysisARFound data.Dispose(); } sessionSubsystem.ApplyWorldMap(worldMap); - UpdateTrackableInfoWithPose(Vector3.zero, Quaternion.identity); // before trying to find an anchor: default pause is origin of the map + //UpdateTrackableInfoWithPose(Vector3.zero, Quaternion.identity); // before trying to find an anchor: default pause is origin of the map } } }