void InitializeTile(string TileNum, int tx, int ty, int zoom) { TileCount++; Console.WriteLine("Tile:" + TileCount + " Initialize " + tx + "," + ty); MTerrainTile tile = new MTerrainTile(tx, ty, ZoomLevel, CurrentBody.Radius.X); tile.SetShader(TerrainShader); Tiles.Add(TileNum, tile); MScene.Background.Add(Tiles[TileNum]); MTerrainBoundary tb = CurrentBody.GetTileBoundaryLonLat(tx, ty, ZoomLevel); double metersperpixel = CurrentBody.GroundResolution(tb.LonLatTL.Y, ZoomLevel); //Tiles[TileNum].transform.Scale = new Vector3d(256*metersperpixel, 1, 256 *metersperpixel); //Vector3d ll = CurrentBody.TileToLonLat(tx, ty, zoom); Vector3d ll = tb.LonLatTL; //Vector3d pos = CurrentBody.LonLatToUniPosition(ll.X, ll.Y, 0); Vector3d pos = MGISTools.LonLatMercatorToPosition(ll.X, ll.Y, CurrentBody.Radius.X) + CurrentBody.Position; Tiles[TileNum].transform.Position = pos; Tiles[TileNum].SetBoundary(tb); Tiles[TileNum].Setup(CurrentBody); }
public void SetBoundary(MTerrainBoundary b) { Boundary = b; }