# Noise2D

Engine/source/util/noise2d.h

More...

## Noise

These functions actually generate noise values into the passed in destination array.

Note that the output values of these functions are from -1.0 to 1.0.

fBm - Fractal Brownian Motion - A simple noise generation algorithm, it tends to generate either flowing rounded hills or rounded mountainous shapes.

```void
```
```fBm(Vector< F32 > * dst, U32 size, U32 interval, F32 h, F32 octave)
```
```void
```
```rigidMultiFractal(Vector< F32 > * dst, Vector< F32 > * signal, U32 size, U32 interval, F32 h, F32 octave)
```

rigidMultiFractal Creates ridged mountains with a high frequency detail.

## Private Types

enum
```Constants {
SIZE = 0x100
}
```

## Private Attributes

```F32
```
```mGradient [SIZE+SIZE+2][2]
```
```S32
```
```mPermutation [SIZE+SIZE+2]
```
```MRandom
```
```mRandom
```
```U32
```
```mSeed
```

## Private Functions

```F32
```
```curve(F32 t)
```
```F32
```
```dot(const F32 * q, F32 rx, F32 ry)
```
```F32
```
```lerp(F32 t, F32 a, F32 b)
```
```void
```
```normalize(F32 v)
```
```void
```
```setup(F32 t, S32 & b0, S32 & b1, F32 & r0, F32 & r1)
```

## Public Functions

```Noise2D()
```
```~Noise2D()
```
```bool
```
```erodeHydraulic(Vector< F32 > * src, Vector< F32 > * dst, U32 iterations, U32 size)
```
```bool
```
```erodeThermal(Vector< F32 > * src, Vector< F32 > * dst, F32 slope, F32 materialLoss, U32 iterations, U32 size, U32 squareSize, F32 maxHeight)
```
```void
```
```getMinMax(Vector< F32 > * src, F32 * maxNoise, F32 * minNoise, U32 size)
```
```U32
```
```getSeed()
```
```F32
```
```getValue(F32 u, F32 v, S32 interval)
```
```void
```
```setSeed(U32 seed)
```
```F32
```
```turbulence(F32 x, F32 y, F32 freq)
```

## Noise

These functions actually generate noise values into the passed in destination array.

Note that the output values of these functions are from -1.0 to 1.0.

fBm - Fractal Brownian Motion - A simple noise generation algorithm, it tends to generate either flowing rounded hills or rounded mountainous shapes.

```fBm(Vector< F32 > * dst, U32 size, U32 interval, F32 h, F32 octave)
```

```rigidMultiFractal(Vector< F32 > * dst, Vector< F32 > * signal, U32 size, U32 interval, F32 h, F32 octave)
```

rigidMultiFractal Creates ridged mountains with a high frequency detail.

## Private Types

```Constants
```

SIZE = 0x100

## Private Attributes

```F32 mGradient [SIZE+SIZE+2][2]
```
```S32 mPermutation [SIZE+SIZE+2]
```
```MRandom mRandom
```
```U32 mSeed
```

## Private Functions

```curve(F32 t)
```

```dot(const F32 * q, F32 rx, F32 ry)
```

```lerp(F32 t, F32 a, F32 b)
```

```normalize(F32 v)
```

```setup(F32 t, S32 & b0, S32 & b1, F32 & r0, F32 & r1)
```

## Public Functions

```Noise2D()
```

```~Noise2D()
```

```erodeHydraulic(Vector< F32 > * src, Vector< F32 > * dst, U32 iterations, U32 size)
```

```erodeThermal(Vector< F32 > * src, Vector< F32 > * dst, F32 slope, F32 materialLoss, U32 iterations, U32 size, U32 squareSize, F32 maxHeight)
```

```getMinMax(Vector< F32 > * src, F32 * maxNoise, F32 * minNoise, U32 size)
```

```getSeed()
```

```getValue(F32 u, F32 v, S32 interval)
```

```setSeed(U32 seed)
```

```turbulence(F32 x, F32 y, F32 freq)
```