Parameters: LandRandom * seed, int w, int h
Returns: LandPerlin*
Create a Perlin noise of the given resolution.
The noise at any integer coordinate is always 0. Other coordinates return a random value in the range -1..1. If w and h are 1, each noise sample will have the identical vector at each corner. For point 0.5/0.5 this means: a = 0.5 * u + 0.5 * v b = -0.5 * u + 0.5 * v c = 0.5 * u + -0.5 * v d = -0.5 * u + -0.5 * v a + b + c + d = 0 result = 0 Also any other point: a = x * u + y * v b = -X * u + y * v c = x * u + -Y * v d = -X * u + -Y * v e = X * a + x * b = xX * u + yX * v + -xX * u + xy * v f = X * c + x * d = xX * u + -XY * v + -xX * u + -xY * v result = Y * e + y * f = xXY * u + yXY * v + -xXY * u + xyY * v + xXy * u + -XYy * v + -xXy * u + -xYy * v u * (xXY - xXY + xXy - xXy) + v * (yXY + xyY - XYy - xYy) u * 0 + v * 0 0 Note that this is not necessarily true for non-linear interpolation.
Parameters: LandPerlin * self, float(* lerp)(float a, float b, float p)
Parameters: LandPerlin * self, LandPerlinLerp lerp
Parameters: LandPerlin * self
Parameters: LandPerlin * self, float x, float y
Returns: float
Get a noise value from a Perlin noise. If x/y are not from inside the resolution of the noise they will wrap around.
Parameters: LandPerlin * self, float x, float y, float * xd, float * yd
Instead of getting the result of the Perlin noise at x/y, directly get the random displacement vector xd/yd.