public DistortedNoise3D(INoise3D noise, INoiseDistorter3D distorter)
        {
            Contracts.Requires.That(noise != null);
            Contracts.Requires.That(distorter != null);

            this.noise     = noise;
            this.distorter = distorter;
        }
Exemple #2
0
        public NoiseWorldVoxelGridChunkPopulator(
            INoise3D noise, double noiseScaling, int numberOfOctaves, TerrainMaterial material)
        {
            Contracts.Requires.That(noise != null);
            Contracts.Requires.That(noiseScaling > 0);
            Contracts.Requires.That(numberOfOctaves >= 1);

            this.noise     = noise;
            this.distorter = NoiseDistorter.New()
                             .Frequency(noiseScaling, noiseScaling, noiseScaling).Octaves(numberOfOctaves);
            this.material = material;
        }
 // TODO Steven - this constructor should probably be a static factory method...
 public NoiseSeedSurfaceGenerator(
     ISurfaceValueGenerator <TVoxel, TSurfaceData, TValue> generator,
     IFactory <int, INoise3D> noiseFactory,
     INoiseDistorter3D noiseDistorter)
     : this(
         generator,
         new DistortedNoise3D(noiseFactory.Create(0), noiseDistorter),
         new DistortedNoise3D(noiseFactory.Create(1), noiseDistorter),
         new DistortedNoise3D(noiseFactory.Create(2), noiseDistorter),
         new DistortedNoise3D(noiseFactory.Create(3), noiseDistorter),
         new DistortedNoise3D(noiseFactory.Create(4), noiseDistorter),
         new DistortedNoise3D(noiseFactory.Create(5), noiseDistorter))
 {
     Contracts.Requires.That(generator != null);
     Contracts.Requires.That(noiseFactory != null);
     Contracts.Requires.That(noiseDistorter != null);
 }