Package org.matheusdev.util

Examples of org.matheusdev.util.FastRand


        int sum = 0;
        for (int i = 0; i < strengths.length; i++) sum += strengths[i];
        this.strengthSum = sum;

        FastRand rand = new FastRand(seed);

        offsets = new int[layers.length*3];
        for (int i = 0; i < offsets.length; i++) {
            offsets[i] = rand.randInt(128);
        }
    }
View Full Code Here


  protected final int density;
  protected final FastRand rand;
  protected final FloatInterpolation interpolator;

  public SimplexNoiseLayerLazy3(final int density, final FloatInterpolation interpolator) {
    this(new FastRand().randLong(), density, interpolator);
  }
View Full Code Here

  }

  public SimplexNoiseLayerLazy3(final long seed, final int density, final FloatInterpolation interpolator) {
    this.density = density;
    this.seed = seed;
    this.rand = new FastRand();
    this.interpolator = interpolator;
  }
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {
    final int w = 20;
    final int h = 20;
    final FastRand rand = new FastRand();

    MatrixNbl mat = new MatrixNbl(w, h);

    System.out.println("Precent elements: " + mat.values.length);
    System.out.println("Actually needed elements: " + ((w * h) / 8));
    System.out.println("w * h: " + (w * h));

    for (int y = 0; y < h; y++) {
      for (int x = 0; x < w; x++) {
        boolean bool = rand.randBool();
        mat.set(bool, x, y);
        System.out.print(bool ? "#" : ".");
      }
      System.out.println();
    }
View Full Code Here

        float t2 = t * t;
        return 3 * t2 - 2 * t2 * t;
      }
    };

    SimplexNoiseLazy3 noise = new SimplexNoiseLazy3(new FastRand().randLong(), 6, 2, interp);

        Noise3GifGenerator.gen(noise, width, height, 64);
  }
View Full Code Here

        float t2 = t * t;
        return 3 * t2 - 2 * t2 * t;
      }
    };

    SimplexNoiseLazy2 noise = new SimplexNoiseLazy2(new FastRand().randLong(), 6, 4, interp);

        Noise2PngGenerator.gen(noise, width, height);
  }
View Full Code Here

  protected final int density;
  protected final FastRand rand;
  protected final FloatInterpolation interpolator;

  public SimplexNoiseLayerLazy2(final int density, final FloatInterpolation interpolator) {
    this(new FastRand().randLong(), density, interpolator);
  }
View Full Code Here

  }

  public SimplexNoiseLayerLazy2(final long seed, final int density, final FloatInterpolation interpolator) {
    this.density = density;
    this.seed = seed;
    this.rand = new FastRand();
    this.interpolator = interpolator;
  }
View Full Code Here

        int sum = 0;
        for (int i = 0; i < strengths.length; i++) sum += strengths[i];
        this.strengthSum = sum;

        FastRand rand = new FastRand(seed);

        offsets = new int[layers.length*2];
        for (int i = 0; i < offsets.length; i++) {
            offsets[i] = rand.randInt(128);
        }
    }
View Full Code Here

TOP

Related Classes of org.matheusdev.util.FastRand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.