Example #1
0
 public void InitializePlanet()
 {
     planetGenerator        = GetComponent <PlanetGenerator>();
     planetGenerator.planet = this;
     cube  = planetGenerator.cubeGenerator.GenerateCube(this);
     faces = cube.faces;
     PlanetGenerator.CreateGenerators(false); //True will force a new generator to be created, false will only init if none already made
     PlanetGenerator.UpdateGenerators();
 }
Example #2
0
        public Chunk(Planet planet, Face face, int u, int v)
        {
            this.planet          = planet;
            this.face            = face;
            this.faceCoord       = new IUV(face.index, u, v);
            this.planetGenerator = planet.PlanetGenerator;

            CalculateCentre(planet.faceResolution, planet.radius);

            //Add lod levels based on planet presets
            lodMeshes = new LodData[planet.detailLevels.Length];
            for (int i = 0; i < planet.detailLevels.Length; i++)
            {
                lodMeshes[i] = new LodData(planet.detailLevels[i].lod, UpdateChunk, planetGenerator);
            }

            //Debug.Log("Chunk [" + iuv.x + "," + iuv.y + "," + iuv.z + "] has been constructed");
        }
Example #3
0
 //called in Chunk init
 public LodData(int lod, System.Action updateCallback, PlanetGenerator planetGenerator)
 {
     this.lod             = lod;
     this.updateCallback  = updateCallback;
     this.planetGenerator = planetGenerator;
 }
 public MeshGenerator(PlanetGenerator planetGenerator, int resolution)
 {
     this.planetGenerator = planetGenerator;
     this.borderedSize    = resolution;
     this.faceResolution  = planetGenerator.planet.faceResolution;
 }
 public ChunkGenerator(PlanetGenerator planetGenerator, int resolution)
 {
     this.planetGenerator = planetGenerator;
     this.resolution      = resolution;
 }