24 lines
485 B
C++
24 lines
485 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <cstdint>
|
|
#include "ZLMath.h"
|
|
|
|
namespace ZL {
|
|
|
|
class PerlinNoise {
|
|
std::vector<int> p;
|
|
public:
|
|
PerlinNoise();
|
|
PerlinNoise(uint64_t seed);
|
|
|
|
float fade(float t);
|
|
float lerp(float t, float a, float b);
|
|
float grad(int hash, float x, float y, float z);
|
|
|
|
float noise(float x, float y, float z);
|
|
|
|
float getSurfaceHeight(Vector3f pos, float noiseCoeff);
|
|
};
|
|
|
|
} // namespace ZL
|