Exemple #1
0
        public float NextInRange(IRandom0 rand, float from, float to)
        {
            if (from > to)
            {
                throw new ArgumentException("from > to");
            }
            var d = rand.NextF();

            var res = from + (to - from) * d;

            return((float)res);
        }
Exemple #2
0
 public PerlinNoise(INoiseParameters noiseParameters)
 {
     _rand            = noiseParameters.Random;
     _noiseParameters = noiseParameters;
 }
Exemple #3
0
 public VoronoiAreaGenerator(IVoronoiGenerator voronoi, IRandom0 random)
 {
     _voronoiGenerator = voronoi;
     _random           = random;
     _randomHelper     = new PropabilityHelperRandom0();
 }
Exemple #4
0
 public INoiseBuilder Random(IRandom0 rand)
 {
     _descriptor.Random = rand;
     return(this);
 }