.Math. Noise

Simple Noise class, (can't remember where I got it from, however, it seems really similar to this and this).

Constructor

new Noise(amp, scl, randFunc)

Create a new Noise class.

Parameters:
NameTypeDefaultDescription
ampnumber1

The amplitude of the noise.

sclnumber0.05

The scale of the noise.

randFuncfunctionMath.random

The random function used for generating the noise. For seeded noise, where srand is an HB.Math.SeededRandom instance, use '() => { srand.value(); }'.

Methods

value(x) → {number}

Get the noise value at a specific value.

Parameters:
NameTypeDescription
xnumber

The value.

Returns:
Type: 
number