Beispiel #1
0
    public void GenerateVoxelsForCoord(int cx, int cz)
    {
        int maxLevel = GetGroundLevel(cx, cz);

        if (maxLevel <= 0)
        {
            maxLevel = 1;
        }

        var bil = billow.GetValue(cx / 100.0, 0, cz / 100.0) * 5.0;

        var max = Mathf.Max(maxLevel, 15);

        for (int la = 0; la < max; la++)
        {
            int realy = la - 16;
            //var val = billow.GetValue(la/10.0, 12830.0 + cx/10.0, 29821.0 + cz/10.0);
            int type = la == max - 1 ? 1 : 3;
            if (maxLevel > 10 + 16 + bil)
            {
                type = 4;
            }
            if (maxLevel < 3 + 16 + bil)
            {
                type = 6;
            }
            //if (val < -0.5) type = 4;
            if (la > maxLevel)
            {
                type = 64;
            }
            PlaceVoxel(cx, realy, cz, type);
        }
        max      -= 16;
        sygnalize = false;
        foreach (var gen in generables)
        {
            if (gen.ConditionMet(cx, max, cz, billow))
            {
                gen.Generate(PlaceVoxel, cx, max, cz);
            }
        }
        sygnalize = true;
    }
Beispiel #2
0
        protected override Vector3 _ModifyOffset(VertexData vertexData)
        {
            if (!noiseModule.IsDisposed)
            {
                noiseModule.Dispose();
            }

            var value = 0.5f + (float)noiseModule.GetValue(GetSampleCoordinate(vertexData.position));

            return(FormatValue(value, vertexData));
        }
Beispiel #3
0
        void PopulateChunk(int x, int y, int z)
        {
            x *= m.GetChunkSize();
            y *= m.GetChunkSize();
            z *= m.GetChunkSize();
            //forests
            double count = treenoise.GetValue(x / 512.0, 0, y / 512.0) * 1000;

            {
                count = System.Math.Min(count, 300);
                MakeSmallTrees(x, y, z, m.GetChunkSize(), _rnd, (int)count);
            }
            //random trees
            MakeSmallTrees(x, y, z, m.GetChunkSize(), _rnd, treeCount + 10 - (10 - treeCount / 10));
        }
Beispiel #4
0
        public float Get(int x, int y)
        {
            float v = 0;

            if (generator == Generator.Vonoroi)
            {
                v = (float)vonoroi.GetValue((x + offset) / scale, 0, (y + offset) / scale) * power;
            }
            else if (generator == Generator.Perlin)
            {
                v = (float)perlin.GetValue((x + offset) / scale, 0, (y + offset) / scale) * power;
            }
            else if (generator == Generator.Billow)
            {
                v = (float)billow.GetValue((x + offset) / scale, 0, (y + offset) / scale) * power;
            }
            return(v);
        }
        public void PopulateChunk(IMapStorage map, int x, int y, int z)
        {
            x *= this.ChunkSize;
            y *= this.ChunkSize;
            z *= this.ChunkSize;
            //forests
            //if (Math.Abs(treenoise.GetValue(x, 0, y)) >= 0.9)
            double count = treenoise.GetValue(x, 0, y) * 1000;

            {
                count = System.Math.Min(count, 300);
                PopulationTools.MakeSmallTrees(map, x, y, z, this.ChunkSize, _rnd, (int)count);
            }
            //random trees
            PopulationTools.MakeSmallTrees(map, x, y, z, this.ChunkSize, _rnd, treeCount + 10 - (10 - treeCount / 10));

            PopulationTools.MakeCaves(map, x, y, z, this.ChunkSize, _rnd, this.EnableCaves, gravellength, goldorelength, ironorelength, coalorelength, dirtlength, silverlength);
        }
 public override void OnVertexBuildHeight(PQS.VertexBuildData data)
 {
     if (data.vertHeight > finalStart && data.vertHeight < finalEnd)
     {
         if (modMode == 1)
         {
             data.vertHeight += billow.GetValue(data.directionFromCenter) * deformity;
         }
         if (modMode == 2)
         {
             data.vertHeight += hybrid.GetValue(data.directionFromCenter) * deformity;
         }
         if (modMode == 3)
         {
             data.vertHeight += perlin.GetValue(data.directionFromCenter) * deformity;
         }
         if (modMode == 4)
         {
             data.vertHeight += rigged.GetValue(data.directionFromCenter) * deformity;
         }
     }
 }
Beispiel #7
0
        public unsafe static void Generate(Level lvl, string type, int seed, bool useSeed)
        {
            int index = 0, width = lvl.Width, height = lvl.Height, length = lvl.Length;

            byte[]          blocks = lvl.blocks;
            int             half = height / 2;
            RealisticMapGen generator = new RealisticMapGen();
            IModule         module2D = null, module3D = null;

            switch (type)
            {
            case "flat":
                int grassHeight = height / 2;
                if (useSeed && seed >= 0 && seed < height)
                {
                    lvl.EdgeLevel = (short)seed;
                    grassHeight   = seed;
                }

                fixed(byte *ptr = blocks)
                {
                    if (grassHeight > 0)
                    {
                        MapSet(lvl.Width, lvl.Length, ptr, 0, grassHeight - 1, Block.dirt);
                    }
                    if (grassHeight < lvl.Height)
                    {
                        MapSet(lvl.Width, lvl.Length, ptr, grassHeight, grassHeight, Block.grass);
                    }
                }

                return;

            case "pixel":
                for (int y = 0; y < height; ++y)
                {
                    for (int z = 0; z < length; ++z)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            if (y == 0)
                            {
                                blocks[index] = Block.blackrock;
                            }
                            else if (x == 0 || x == width - 1 || z == 0 || z == length - 1)
                            {
                                blocks[index] = Block.white;
                            }
                            index++;
                        }
                    }
                }
                return;

            case "empty":
                for (int z = 0; z < length; ++z)
                {
                    for (int x = 0; x < width; ++x)
                    {
                        blocks[index++] = Block.blackrock;
                    }
                }
                return;

            case "space":
                Random random = useSeed ? new Random(seed) : new Random();
                for (int y = 0; y < height; ++y)
                {
                    for (int z = 0; z < length; ++z)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            if (y == 0)
                            {
                                blocks[index] = Block.blackrock;
                            }
                            else if (x == 0 || x == width - 1 || z == 0 || z == length - 1 || y == 1 || y == height - 1)
                            {
                                blocks[index] = random.Next(100) == 0 ? Block.iron : Block.obsidian;
                            }
                            index++;
                        }
                    }
                }
                break;

            case "rainbow":
                Random random2 = useSeed ? new Random(seed) : new Random();
                for (int y = 0; y < height; ++y)
                {
                    for (int z = 0; z < length; ++z)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            if (y == 0 || y == height - 1 || x == 0 || x == width - 1 || z == 0 || z == length - 1)
                            {
                                blocks[index] = (byte)random2.Next(Block.red, Block.white);
                            }
                            index++;
                        }
                    }
                }
                return;

            case "hell":
                Random random3 = useSeed ? new Random(seed) : new Random();
                for (int y = 0; y < height; ++y)
                {
                    for (int z = 0; z < length; ++z)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            if (y == 0)
                            {
                                blocks[index] = Block.blackrock;
                            }
                            else if (x == 0 || x == width - 1 || z == 0 || z == length - 1 || y == 0 || y == height - 1)
                            {
                                blocks[index] = Block.obsidian;
                            }
                            else if (x == 1 || x == width - 2 || z == 1 || z == length - 2)
                            {
                                if (random3.Next(1000) != 7)
                                {
                                    index++; continue;
                                }
                                int colIndex = z * width + x;
                                for (int i = 1; i < (height - y); ++i)
                                {
                                    int yy = height - i;
                                    blocks[colIndex + yy * width * length] = Block.lava;
                                }
                            }
                            index++;
                        }
                    }
                }
                generator.GenerateMap(lvl, type, seed, useSeed); return;

            case "billow":
                module2D = new Billow();
                ((Billow)module2D).Seed = useSeed ? seed : new Random().Next(); break;

            case "ridgedmultifractal":
                module2D = new RidgedMultifractal();
                ((RidgedMultifractal)module2D).Seed = useSeed ? seed : new Random().Next(); break;

            case "perlin":
                module2D = new Perlin();
                ((Perlin)module2D).Seed = useSeed ? seed : new Random().Next(); break;

            case "checkerboard":
                module2D = new Checkerboard(); break;

            case "spheres":
                module2D = new Spheres(); break;

            case "cylinders":
                module2D = new Cylinders(); break;

            case "voronoi":
                module2D = new Voronoi();
                ((Voronoi)module2D).Seed = useSeed ? seed : new Random().Next(); break;

            case "perlin3d":
                module3D = new Perlin();
                ((Perlin)module3D).Seed = useSeed ? seed : new Random().Next(); break;

            case "perlin3dyadjust":
                Perlin adjNoise = new Perlin();
                adjNoise.Seed = useSeed ? seed : new Random().Next();
                for (int y = 0; y < height; y++)
                {
                    for (int z = 0; z < length; ++z)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            double value = System.Math.Floor((adjNoise.GetValue(x / 100.0, y / 100.0, z / 100.0) + 2) * 10);
                            if (value > 30 * y / height)
                            {
                                lvl.SetTile((ushort)x, (ushort)y, (ushort)z, Block.grass);
                            }
                        }
                    }
                }
                break;

            case "billow3d":
                module3D = new Billow();
                ((Billow)module3D).Seed = useSeed ? seed : new Random().Next(); break;

            case "island":
            case "mountains":
            case "ocean":
            case "forest":
            case "desert":
                generator.GenerateMap(lvl, type, seed, useSeed); return;
            }

            if (module2D != null)
            {
                int waterlvl = half - 1;
                for (int z = 0; z < length; ++z)
                {
                    for (int x = 0; x < width; ++x)
                    {
                        double noise         = module2D.GetValue(x / 100.0, 0.1, z / 100.0);
                        int    height2D      = (int)System.Math.Floor((noise + 2) * 10) + (half - 20);
                        int    height2Dtex01 = (int)System.Math.Floor((noise + 2) * 15) + (half - 30);
                        byte   topBlock      = height2D < height2Dtex01 ? Block.grass : Block.sand;
                        lvl.SetTile((ushort)x, (ushort)height2D, (ushort)z, topBlock);

                        if (height2D < waterlvl)
                        {
                            for (int y = waterlvl; y >= height2D; y--)
                            {
                                lvl.SetTile((ushort)x, (ushort)y, (ushort)z, Block.water);
                            }
                        }
                        for (int y = height2D - 1; y >= 0; y--)
                        {
                            byte block = (y > height2D * 3 / 4) ? Block.dirt : Block.rock;
                            lvl.SetTile((ushort)x, (ushort)y, (ushort)z, block);
                        }
                    }
                }
            }

            if (module3D != null)
            {
                for (int y = 0; y < height; y++)
                {
                    for (int z = 0; z < length; ++z)
                    {
                        for (int x = 0; x < width; ++x)
                        {
                            double value = System.Math.Floor((module3D.GetValue(x / 100.0, y / 100.0, z / 100.0) + 2) * 10);
                            if (value > 20)
                            {
                                lvl.SetTile((ushort)x, (ushort)y, (ushort)z, Block.grass);
                            }
                        }
                    }
                }
            }
        }
Beispiel #8
0
        public override void OnVertexBuildHeight(PQS.VertexBuildData data)
        {
            //Activate OCD mode.
            switch (command)
            {
            case Command.Addition:
                #region Addition
                if (modMode3 == 1.1)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) + (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.2)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) + (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.3)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) + (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.4)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) + (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.5)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) + (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.6)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) + (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 2.1)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) + (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.2)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) + (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.3)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) + (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.4)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) + (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.5)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) + (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.6)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) + (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 3.1)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) + (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.2)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) + (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.3)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) + (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.4)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) + (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.5)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) + (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.6)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) + (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 4.1)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) + (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.2)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) + (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.3)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) + (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.4)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) + (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.5)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) + (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.6)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) + (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 5.1)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) + (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.2)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) + (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.3)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) + (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.4)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) + (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.5)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) + (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.6)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) + (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 6.1)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) + (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.2)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) + (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.3)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) + (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.4)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) + (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.5)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) + (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.6)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) + (vor2.GetValue(data.directionFromCenter) * deformity);
                }
                #endregion
                break;

            case Command.Subtract:
                #region Subtract
                if (modMode3 == 1.1)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) - (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.2)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) - (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.3)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) - (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.4)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) - (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.5)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) - (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.6)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) - (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 2.1)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) - (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.2)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) - (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.3)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) - (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.4)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) - (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.5)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) - (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.6)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) - (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 3.1)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) - (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.2)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) - (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.3)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) - (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.4)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) - (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.5)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) - (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.6)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) - (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 4.1)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) - (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.2)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) - (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.3)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) - (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.4)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) - (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.5)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) - (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.6)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) - (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 5.1)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) - (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.2)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) - (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.3)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) - (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.4)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) - (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.5)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) - (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.6)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) - (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 6.1)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) - (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.2)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) - (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.3)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) - (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.4)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) - (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.5)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) - (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.6)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) - (vor2.GetValue(data.directionFromCenter) * deformity);
                }
                #endregion
                break;

            case Command.Multiply:
                #region Multiply
                if (modMode3 == 1.1)
                {
                    data.vertHeight += bill1.GetValue(data.directionFromCenter) * deformity * bill2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 1.2)
                {
                    data.vertHeight += bill1.GetValue(data.directionFromCenter) * deformity * hyb2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 1.3)
                {
                    data.vertHeight += bill1.GetValue(data.directionFromCenter) * deformity * perlin2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 1.4)
                {
                    data.vertHeight += bill1.GetValue(data.directionFromCenter) * deformity * rig2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 1.5)
                {
                    data.vertHeight += bill1.GetValue(data.directionFromCenter) * deformity * simplex2.noise(data.directionFromCenter);
                }
                if (modMode3 == 1.6)
                {
                    data.vertHeight += bill1.GetValue(data.directionFromCenter) * deformity * vor2.GetValue(data.directionFromCenter);
                }



                if (modMode3 == 2.1)
                {
                    data.vertHeight += hyb1.GetValue(data.directionFromCenter) * deformity * bill2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 2.2)
                {
                    data.vertHeight += hyb1.GetValue(data.directionFromCenter) * deformity * hyb2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 2.3)
                {
                    data.vertHeight += hyb1.GetValue(data.directionFromCenter) * deformity * perlin2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 2.4)
                {
                    data.vertHeight += hyb1.GetValue(data.directionFromCenter) * deformity * rig2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 2.5)
                {
                    data.vertHeight += hyb1.GetValue(data.directionFromCenter) * deformity * simplex2.noise(data.directionFromCenter);
                }
                if (modMode3 == 2.6)
                {
                    data.vertHeight += hyb1.GetValue(data.directionFromCenter) * deformity * vor2.GetValue(data.directionFromCenter);
                }



                if (modMode3 == 3.1)
                {
                    data.vertHeight += perlin1.GetValue(data.directionFromCenter) * deformity * bill2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 3.2)
                {
                    data.vertHeight += perlin1.GetValue(data.directionFromCenter) * deformity * hyb2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 3.3)
                {
                    data.vertHeight += perlin1.GetValue(data.directionFromCenter) * deformity * perlin2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 3.4)
                {
                    data.vertHeight += perlin1.GetValue(data.directionFromCenter) * deformity * rig2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 3.5)
                {
                    data.vertHeight += perlin1.GetValue(data.directionFromCenter) * deformity * simplex2.noise(data.directionFromCenter);
                }
                if (modMode3 == 3.6)
                {
                    data.vertHeight += perlin1.GetValue(data.directionFromCenter) * deformity * vor2.GetValue(data.directionFromCenter);
                }



                if (modMode3 == 4.1)
                {
                    data.vertHeight += rig1.GetValue(data.directionFromCenter) * deformity * bill2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 4.2)
                {
                    data.vertHeight += rig1.GetValue(data.directionFromCenter) * deformity * hyb2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 4.3)
                {
                    data.vertHeight += rig1.GetValue(data.directionFromCenter) * deformity * perlin2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 4.4)
                {
                    data.vertHeight += rig1.GetValue(data.directionFromCenter) * deformity * rig2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 4.5)
                {
                    data.vertHeight += rig1.GetValue(data.directionFromCenter) * deformity * simplex2.noise(data.directionFromCenter);
                }
                if (modMode3 == 4.6)
                {
                    data.vertHeight += rig1.GetValue(data.directionFromCenter) * deformity * vor2.GetValue(data.directionFromCenter);
                }



                if (modMode3 == 5.1)
                {
                    data.vertHeight += simplex1.noise(data.directionFromCenter) * deformity * bill2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 5.2)
                {
                    data.vertHeight += simplex1.noise(data.directionFromCenter) * deformity * hyb2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 5.3)
                {
                    data.vertHeight += simplex1.noise(data.directionFromCenter) * deformity * perlin2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 5.4)
                {
                    data.vertHeight += simplex1.noise(data.directionFromCenter) * deformity * rig2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 5.5)
                {
                    data.vertHeight += simplex1.noise(data.directionFromCenter) * deformity * simplex2.noise(data.directionFromCenter);
                }
                if (modMode3 == 5.6)
                {
                    data.vertHeight += simplex1.noise(data.directionFromCenter) * deformity * vor2.GetValue(data.directionFromCenter);
                }



                if (modMode3 == 6.1)
                {
                    data.vertHeight += vor1.GetValue(data.directionFromCenter) * deformity * bill2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 6.2)
                {
                    data.vertHeight += vor1.GetValue(data.directionFromCenter) * deformity * hyb2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 6.3)
                {
                    data.vertHeight += vor1.GetValue(data.directionFromCenter) * deformity * perlin2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 6.4)
                {
                    data.vertHeight += vor1.GetValue(data.directionFromCenter) * deformity * rig2.GetValue(data.directionFromCenter);
                }
                if (modMode3 == 6.5)
                {
                    data.vertHeight += vor1.GetValue(data.directionFromCenter) * deformity * simplex2.noise(data.directionFromCenter);
                }
                if (modMode3 == 6.6)
                {
                    data.vertHeight += vor1.GetValue(data.directionFromCenter) * deformity * vor2.GetValue(data.directionFromCenter);
                }
                #endregion
                break;

            case Command.Divide:
                #region Divide
                if (modMode3 == 1.1)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) / (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.2)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) / (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.3)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) / (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.4)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) / (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.5)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) / (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 1.6)
                {
                    data.vertHeight += (bill1.GetValue(data.directionFromCenter) * deformity) / (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 2.1)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) / (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.2)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) / (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.3)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) / (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.4)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) / (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.5)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) / (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 2.6)
                {
                    data.vertHeight += (hyb1.GetValue(data.directionFromCenter) * deformity) / (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 3.1)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) / (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.2)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) / (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.3)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) / (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.4)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) / (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.5)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) / (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 3.6)
                {
                    data.vertHeight += (perlin1.GetValue(data.directionFromCenter) * deformity) / (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 4.1)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) / (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.2)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) / (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.3)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) / (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.4)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) / (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.5)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) / (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 4.6)
                {
                    data.vertHeight += (rig1.GetValue(data.directionFromCenter) * deformity) / (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 5.1)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) / (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.2)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) / (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.3)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) / (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.4)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) / (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.5)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) / (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 5.6)
                {
                    data.vertHeight += (simplex1.noise(data.directionFromCenter) * deformity) / (vor2.GetValue(data.directionFromCenter) * deformity);
                }



                if (modMode3 == 6.1)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) / (bill2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.2)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) / (hyb2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.3)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) / (perlin2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.4)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) / (rig2.GetValue(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.5)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) / (simplex2.noise(data.directionFromCenter) * deformity);
                }
                if (modMode3 == 6.6)
                {
                    data.vertHeight += (vor1.GetValue(data.directionFromCenter) * deformity) / (vor2.GetValue(data.directionFromCenter) * deformity);
                }
                #endregion
                break;
            }
            //Ded.
        }
        public override void OnVertexBuildHeight(PQS.VertexBuildData data)
        {
            switch (indexer)
            {
            case Indexer.Billow:
                bill1 = new Billow(frequency, lacunarity, persistence, Convert.ToInt32(octaves), seed, mode);
                if (onlyOnOcean)
                {
                    if (data.vertHeight < internalRadius)
                    {
                        if (bill1.GetValue(data.directionFromCenter) > cutoff)
                        {
                            data.vertHeight += deformity + offset;
                        }
                    }
                }
                if (!onlyOnOcean)
                {
                    if (bill1.GetValue(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight += deformity + offset;
                    }
                }
                if (addNoise)
                {
                    var Simp2 = new Simplex(seed, octaves, persistence, frequency);
                    if (bill1.GetValue(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight = Simp2.noise(data.directionFromCenter) * noiseDeformity;
                    }
                }
                break;

            case Indexer.Perlin:
                perl1 = new Perlin(frequency, lacunarity, persistence, Convert.ToInt32(octaves), seed, mode);
                if (onlyOnOcean)
                {
                    if (data.vertHeight < internalRadius)
                    {
                        if (perl1.GetValue(data.directionFromCenter) > cutoff)
                        {
                            data.vertHeight += deformity + offset;
                        }
                    }
                }
                if (!onlyOnOcean)
                {
                    if (perl1.GetValue(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight += deformity + offset;
                    }
                }
                if (addNoise)
                {
                    var Simp2 = new Simplex(seed, octaves, persistence, frequency);
                    if (perl1.GetValue(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight = Simp2.noise(data.directionFromCenter) * noiseDeformity;
                    }
                }
                break;

            case Indexer.RiggedMultifractal:
                rig1 = new RiggedMultifractal(frequency, lacunarity, Convert.ToInt32(octaves), seed, mode);
                if (onlyOnOcean)
                {
                    if (data.vertHeight < internalRadius)
                    {
                        if (rig1.GetValue(data.directionFromCenter) > cutoff)
                        {
                            data.vertHeight += deformity + offset;
                        }
                    }
                }
                if (!onlyOnOcean)
                {
                    if (rig1.GetValue(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight += deformity + offset;
                    }
                }

                if (addNoise)
                {
                    var Simp2 = new Simplex(seed, octaves, persistence, frequency);
                    if (rig1.GetValue(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight = Simp2.noise(data.directionFromCenter) * noiseDeformity;
                    }
                }
                break;

            case Indexer.Simplex:
                simp1 = new Simplex(seed, octaves, persistence, frequency);
                if (onlyOnOcean)
                {
                    if (data.vertHeight < internalRadius)
                    {
                        if (simp1.noise(data.directionFromCenter) > cutoff)
                        {
                            data.vertHeight += deformity + offset;
                        }
                    }
                }
                if (!onlyOnOcean)
                {
                    if (simp1.noise(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight += deformity + offset;
                    }
                }
                if (addNoise)
                {
                    var Simp2 = new Simplex(seed, octaves, persistence, frequency);
                    if (simp1.noise(data.directionFromCenter) > cutoff)
                    {
                        data.vertHeight = Simp2.noise(data.directionFromCenter) * noiseDeformity;
                    }
                }
                break;
            }
        }