private void InitializeGalaxyLayers(CelestialBodies.CelestialBody map)
        {
            Quadtree quadtree = new Quadtree(map.Radius, -map.Radius, -map.Radius, map.Radius);
            List <CelestialBodies.Galaxy> galaxies = map.GetAllGalaxies();

            foreach (CelestialBodies.Galaxy galaxy in galaxies)
            {
                quadtree.Insert(galaxy);
            }
            GalaxyLayer_LOD2.GetComponent <ManyLayerController>().Initialize(quadtree);
            GalaxyLayer_LOD3.GetComponent <ManyLayerController>().Initialize(quadtree);
        }
        private void InitializeSectorLayers(CelestialBodies.CelestialBody map)
        {
            Quadtree quadtree = new Quadtree(map.Radius, -map.Radius, -map.Radius, map.Radius);
            List <CelestialBodies.Sector> sectors = map.GetAllSectors();

            foreach (CelestialBodies.Sector sector in sectors)
            {
                quadtree.Insert(sector);
            }
            SectorLayer_LOD1.GetComponent <ManyLayerController>().Initialize(quadtree);
            SectorLayer_LOD2.GetComponent <ManyLayerController>().Initialize(quadtree);
        }
        private void InitializeSolarSystemLayers(CelestialBodies.CelestialBody map)
        {
            Quadtree quadtree = new Quadtree(map.Radius, -map.Radius, -map.Radius, map.Radius);
            List <CelestialBodies.SolarSystem> solarSystems = map.GetAllSolarSystems();

            foreach (CelestialBodies.SolarSystem solarSystem in solarSystems)
            {
                quadtree.Insert(solarSystem);
            }
            SolarSystemLayer_LOD0.GetComponent <ManyLayerController>().Initialize(quadtree);
            SolarSystemLayer_LOD1.GetComponent <ManyLayerController>().Initialize(quadtree);
        }
Exemplo n.º 4
0
        private void Split()
        {
            QuadOne   = new Quadtree(Top, VerticalMedian, HorizontalMedian, Right, MaximumContents);
            QuadTwo   = new Quadtree(Top, VerticalMedian, Left, HorizontalMedian, MaximumContents);
            QuadThree = new Quadtree(VerticalMedian, Bottom, Left, HorizontalMedian, MaximumContents);
            QuadFour  = new Quadtree(VerticalMedian, Bottom, HorizontalMedian, Right, MaximumContents);

            List <Vector4> toInstert = Contents;

            Contents = new List <Vector4>();
            foreach (Vector4 body in toInstert)
            {
                Insert(body);
            }
        }
        private void InitializeSmallBodyLayer(CelestialBodies.CelestialBody map)
        {
            Quadtree quadtree = new Quadtree(map.Radius, -map.Radius, -map.Radius, map.Radius);
            List <CelestialBodies.Planet> planets = map.GetAllPlanets();

            foreach (CelestialBodies.Planet planet in planets)
            {
                quadtree.Insert(planet);
            }
            List <CelestialBodies.Star> stars = map.GetAllStars();

            foreach (CelestialBodies.Star star in stars)
            {
                quadtree.Insert(star);
            }
            SmallBodyLayer_LOD0.GetComponent <ManyLayerController>().Initialize(quadtree);
        }
Exemplo n.º 6
0
 public void Initialize(Quadtree contents)
 {
     Contents = contents;
     InitializeSprites();
     InitializeShaderParameters();
 }