예제 #1
0
        override public ModuleBase GetModule()
        {
            hasSeed = false;
            switch (type)
            {
            case GENERATORTYPE.CONST:
                module = new Const(constValue);
                break;

            case GENERATORTYPE.FBM:
                module  = new Fbm(frequency, lacunarity, gain, octaves, seed, false, false, derivative);
                hasSeed = true;
                break;

            case GENERATORTYPE.RIDGED:
                module  = new Fbm(frequency, lacunarity, gain, octaves, seed, true, false, derivative);
                hasSeed = true;
                break;

            case GENERATORTYPE.BILLOW:
                module  = new Fbm(frequency, lacunarity, gain, octaves, seed, false, true, derivative);
                hasSeed = true;
                break;

            case GENERATORTYPE.IQ:
                module  = new AdvancedNoise(AdvancedNoise.Type.IQ, frequency, lacunarity, gain, octaves, seed);
                hasSeed = true;
                break;

            case GENERATORTYPE.SWISS:
                module = new AdvancedNoise(AdvancedNoise.Type.SWISS, frequency, lacunarity, gain, octaves, seed);
                ((AdvancedNoise)module).ridgedWarp = ridgedWarp;
                hasSeed = true;
                break;

            case GENERATORTYPE.JORDAN:
                module = new AdvancedNoise(AdvancedNoise.Type.JORDAN, frequency, lacunarity, gain, octaves, seed);
                AdvancedNoise tn = (AdvancedNoise)module;
                tn.warp       = warp;
                tn.warp0      = warp0;
                tn.gain1      = gain1;
                tn.damp0      = damp0;
                tn.damp       = damp;
                tn.damp_scale = damp_scale;
                hasSeed       = true;
                break;

            case GENERATORTYPE.CELL:
                module  = new CellNoise(frequency, gain, octaves, seed, distanceFunction, combineFunction);
                hasSeed = true;
                break;

            case GENERATORTYPE.TEXTURE:
                texture = null;
                if (texturePath != "" && texturePath != null)
                {
                    texture = TextureSource.LoadTexture(texturePath);
                }
                module = new TextureSource(texture);
                break;
            }

            SetOutputOptions();
            return(this.module);
        }
예제 #2
0
        public override ModuleBase GetModule()
        {
            hasSeed = false;
            switch(type) {
            case GENERATORTYPE.CONST:
                module = new Const(constValue);
                break;
            case GENERATORTYPE.FBM:
                module = new Fbm(frequency, lacunarity, gain, octaves, seed, false, false, derivative);
                hasSeed = true;
                break;
            case GENERATORTYPE.RIDGED:
                module = new Fbm(frequency, lacunarity, gain, octaves, seed, true, false, derivative);
                hasSeed = true;
                break;
            case GENERATORTYPE.BILLOW:
                module = new Fbm(frequency, lacunarity, gain, octaves, seed, false, true, derivative);
                hasSeed = true;
                break;
            case GENERATORTYPE.IQ:
                module = new AdvancedNoise(AdvancedNoise.Type.IQ, frequency, lacunarity, gain, octaves, seed);
                hasSeed = true;
                break;
            case GENERATORTYPE.SWISS:
                module = new AdvancedNoise(AdvancedNoise.Type.SWISS, frequency, lacunarity, gain, octaves, seed);
                ((AdvancedNoise)module).ridgedWarp = ridgedWarp;
                hasSeed = true;
                break;
            case GENERATORTYPE.JORDAN:
                module = new AdvancedNoise(AdvancedNoise.Type.JORDAN, frequency, lacunarity, gain, octaves, seed);
                AdvancedNoise tn = (AdvancedNoise)module;
                tn.warp = warp;
                tn.warp0 = warp0;
                tn.gain1 = gain1;
                tn.damp0 = damp0;
                tn.damp = damp;
                tn.damp_scale = damp_scale;
                hasSeed = true;
                break;
            case GENERATORTYPE.CELL:
                module = new CellNoise(frequency, gain, octaves, seed, distanceFunction, combineFunction);
                hasSeed = true;
                break;
            case GENERATORTYPE.TEXTURE:
                texture = null;
                if(texturePath != "" && texturePath != null) {
                    texture = TextureSource.LoadTexture(texturePath);
                }
                module = new TextureSource(texture);
                break;
            }

            SetOutputOptions();
            return this.module;
        }