diff options
Diffstat (limited to 'Runtime/Terrain/PerlinNoise.h')
-rw-r--r-- | Runtime/Terrain/PerlinNoise.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Runtime/Terrain/PerlinNoise.h b/Runtime/Terrain/PerlinNoise.h new file mode 100644 index 0000000..7a9a978 --- /dev/null +++ b/Runtime/Terrain/PerlinNoise.h @@ -0,0 +1,16 @@ +#ifndef PERLINNOISE_H +#define PERLINNOISE_H +class PerlinNoise { +public: + static float Noise(float x, float y); + // Returns noise between 0 - 1 + inline static float NoiseNormalized(float x, float y) + { + //-0.697 - 0.795 + 0.697 + float value = Noise(x, y); + value = (value + 0.69F) / (0.793F + 0.69F); + return value; + } +}; + +#endif |