UNPKG

randiny

Version:

<h1 style="margin-bottom: 0">Randiny</h1> <h2 style="font-size: 14px; margin-top: 0">A pseudo random number generator, capable of generating random numbers, and noise maps.</h2>

39 lines 1.23 kB
import RNG from "./RNG"; import RandomNumber from "./RandomNumber"; /** * A random() function, must return a number in the interval [0,1), just like Math.random(). */ export type RandomFn = () => number; /** * Samples the noise field in two dimensions * * Coordinates should be finite, bigger than -2^31 and smaller than 2^31. * @param x * @param y * @returns a number in the interval [-1, 1] */ export type NoiseFunction2D = (x: number, y: number) => RandomNumber; export declare function createNoise2D(rng: RNG): NoiseFunction2D; /** * Samples the noise field in three dimensions * * Coordinates should be finite, bigger than -2^31 and smaller than 2^31. * @param x * @param y * @param z * @returns a number in the interval [-1, 1] */ export type NoiseFunction3D = (x: number, y: number, z: number) => RandomNumber; /** * Creates a 3D noise function * @returns {NoiseFunction3D} */ export declare function createNoise3D(rng: RNG): NoiseFunction3D; /** * Builds a random permutation table. * This is exported only for (internal) testing purposes. * Do not rely on this export. * @private */ export declare function buildPermutationTable(rng: RNG): Uint8Array; //# sourceMappingURL=SimplexNoise.d.ts.map