public void setVoronoiPreset(TerrainToolkit.voronoiPresetData preset) { this.generatorTypeInt = 0; this.generatorType = TerrainToolkit.GeneratorType.Voronoi; this.voronoiTypeInt = (int)preset.voronoiType; this.voronoiType = preset.voronoiType; this.voronoiCells = preset.voronoiCells; this.voronoiFeatures = preset.voronoiFeatures; this.voronoiScale = preset.voronoiScale; this.voronoiBlend = preset.voronoiBlend; }
public void SmoothTerrain(int iterations, float blend) { this.generatorTypeInt = 3; this.generatorType = TerrainToolkit.GeneratorType.Smooth; this.smoothIterations = iterations; this.smoothBlend = blend; this.generateTerrain(new TerrainToolkit.GeneratorProgressDelegate(this.dummyGeneratorProgress)); }
public void setFractalPreset(TerrainToolkit.fractalPresetData preset) { this.generatorTypeInt = 1; this.generatorType = TerrainToolkit.GeneratorType.DiamondSquare; this.diamondSquareDelta = preset.diamondSquareDelta; this.diamondSquareBlend = preset.diamondSquareBlend; }
public void setPerlinPreset(TerrainToolkit.perlinPresetData preset) { this.generatorTypeInt = 2; this.generatorType = TerrainToolkit.GeneratorType.Perlin; this.perlinFrequency = preset.perlinFrequency; this.perlinAmplitude = preset.perlinAmplitude; this.perlinOctaves = preset.perlinOctaves; this.perlinBlend = preset.perlinBlend; }
public void PerlinGenerator(int frequency, float amplitude, int octaves, float blend) { this.generatorTypeInt = 2; this.generatorType = TerrainToolkit.GeneratorType.Perlin; this.perlinFrequency = frequency; this.perlinAmplitude = amplitude; this.perlinOctaves = octaves; this.perlinBlend = blend; this.generateTerrain(new TerrainToolkit.GeneratorProgressDelegate(this.dummyGeneratorProgress)); }
public void NormaliseTerrain(float minHeight, float maxHeight, float blend) { this.generatorTypeInt = 4; this.generatorType = TerrainToolkit.GeneratorType.Normalise; this.normaliseMin = minHeight; this.normaliseMax = maxHeight; this.normaliseBlend = blend; this.generateTerrain(new TerrainToolkit.GeneratorProgressDelegate(this.dummyGeneratorProgress)); }
public void FractalGenerator(float fractalDelta, float blend) { this.generatorTypeInt = 1; this.generatorType = TerrainToolkit.GeneratorType.DiamondSquare; this.diamondSquareDelta = fractalDelta; this.diamondSquareBlend = blend; this.generateTerrain(new TerrainToolkit.GeneratorProgressDelegate(this.dummyGeneratorProgress)); }
private void convertIntVarsToEnums() { int num = this.erosionTypeInt; switch (num) { case 0: { this.erosionType = TerrainToolkit.ErosionType.Thermal; break; } case 1: { this.erosionType = TerrainToolkit.ErosionType.Hydraulic; break; } case 2: { this.erosionType = TerrainToolkit.ErosionType.Tidal; break; } case 3: { this.erosionType = TerrainToolkit.ErosionType.Wind; break; } case 4: { this.erosionType = TerrainToolkit.ErosionType.Glacial; break; } } num = this.hydraulicTypeInt; switch (num) { case 0: { this.hydraulicType = TerrainToolkit.HydraulicType.Fast; break; } case 1: { this.hydraulicType = TerrainToolkit.HydraulicType.Full; break; } case 2: { this.hydraulicType = TerrainToolkit.HydraulicType.Velocity; break; } } num = this.generatorTypeInt; switch (num) { case 0: { this.generatorType = TerrainToolkit.GeneratorType.Voronoi; break; } case 1: { this.generatorType = TerrainToolkit.GeneratorType.DiamondSquare; break; } case 2: { this.generatorType = TerrainToolkit.GeneratorType.Perlin; break; } case 3: { this.generatorType = TerrainToolkit.GeneratorType.Smooth; break; } case 4: { this.generatorType = TerrainToolkit.GeneratorType.Normalise; break; } } num = this.voronoiTypeInt; switch (num) { case 0: { this.voronoiType = TerrainToolkit.VoronoiType.Linear; break; } case 1: { this.voronoiType = TerrainToolkit.VoronoiType.Sine; break; } case 2: { this.voronoiType = TerrainToolkit.VoronoiType.Tangent; break; } } num = this.neighbourhoodInt; if (num == 0) { this.neighbourhood = TerrainToolkit.Neighbourhood.Moore; } else if (num == 1) { this.neighbourhood = TerrainToolkit.Neighbourhood.VonNeumann; } }
public void VoronoiGenerator(TerrainToolkit.FeatureType featureType, int cells, float features, float scale, float blend) { this.generatorTypeInt = 0; this.generatorType = TerrainToolkit.GeneratorType.Voronoi; switch (featureType) { case TerrainToolkit.FeatureType.Mountains: { this.voronoiTypeInt = 0; this.voronoiType = TerrainToolkit.VoronoiType.Linear; break; } case TerrainToolkit.FeatureType.Hills: { this.voronoiTypeInt = 1; this.voronoiType = TerrainToolkit.VoronoiType.Sine; break; } case TerrainToolkit.FeatureType.Plateaus: { this.voronoiTypeInt = 2; this.voronoiType = TerrainToolkit.VoronoiType.Tangent; break; } } this.voronoiCells = cells; this.voronoiFeatures = features; this.voronoiScale = scale; this.voronoiBlend = blend; this.generateTerrain(new TerrainToolkit.GeneratorProgressDelegate(this.dummyGeneratorProgress)); }