diff --git a/Runtime/DownloadTrees.cs b/Runtime/DownloadTrees.cs index 6c1143736355b6781165282f91af07e9506ecade..07f48a857aa7a1c6d3eaf7c9b3846e5391ddbdd2 100644 --- a/Runtime/DownloadTrees.cs +++ b/Runtime/DownloadTrees.cs @@ -82,10 +82,15 @@ namespace Wander private List<TileDownload> requests = new List<TileDownload>(); private List<Task<List<TreeIsland>>> treeIslandTasks; - public void SetGPSCoord(Vector2 gps) + public void SetGPSCoord(Vector4 gps) { wgs84Lat = gps.x; wgs84Lon = gps.y; + // Calc size at original zoom, we might use a diff zoom here (very likely). + float size = (gps.w*2+1)*gps.z; // (NumRings*2+1) is nTiles wide. Times gps.z == tileSize == totalSize. + float tileSize = (float)RDUtils.CalcTileSizeRD( zoom ); + int numTiles = Mathf.FloorToInt( (size + tileSize/2) / tileSize ); + numRings = (numTiles-1)/2 + 1; } internal void CancelAndClean()