Ejemplo n.º 1
0
        public double GetAltitudeForLatLongForPlanet(int planetID, double viewLat, double viewLong)
        {
            Imageset layer = WWTControl.Singleton.GetImagesetByName(Planets.GetNameFrom3dId(planetID));

            if (layer == null)
            {
                return(0);
            }

            int maxX = GetTilesXForLevel(layer, layer.BaseLevel);
            int maxY = GetTilesYForLevel(layer, layer.BaseLevel);

            for (int x = 0; x < maxX; x++)
            {
                for (int y = 0; y < maxY; y++)
                {
                    Tile tile = TileCache.GetTile(layer.BaseLevel, x, y, layer, null);
                    if (tile != null)
                    {
                        if (tile.IsPointInTile(viewLat, viewLong))
                        {
                            return(tile.GetSurfacePointAltitude(viewLat, viewLong, true));
                        }
                    }
                }
            }
            return(0);
        }