mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 14:43:34 +00:00
Added alot of parameters to make the generator way more natural, also added classes for 3D but not currently used
My mental health is dwindling
This commit is contained in:
@@ -11,20 +11,30 @@
|
||||
class Noise
|
||||
{
|
||||
public:
|
||||
Noise(const std::uint32_t seed = 42);
|
||||
Noise(const std::uint32_t seed = 42, float frequency = 0.05f, float amplitude = 0.9f, int octaves = 4, float lacunarity = 2.0f, float persistance = 0.5f);
|
||||
|
||||
[[nodiscard]] std::array<std::uint32_t, CHUNK_SIZE.y> GetHeight(Scop::Vec2i pos);
|
||||
float perlin2D(float x, float y);
|
||||
int perlin2D(int x, int y);
|
||||
const float perlin2D(float x, float y);
|
||||
const int perlin2D(int x, int y);
|
||||
const int perlin2D2(float x, float y);
|
||||
const int perlin3D(int x, int y, int z);
|
||||
const float perlin3D(float x, float y, float z);
|
||||
const int perlin3D2(float x, float y, float z);
|
||||
~Noise() = default;
|
||||
|
||||
private:
|
||||
std::mt19937 seed;
|
||||
std::array<int, NOISE_SIZE> perms;
|
||||
const float frequency;
|
||||
const float amplitude;
|
||||
const int octaves;
|
||||
const float lacunarity;
|
||||
const float persistance;
|
||||
void InitPermutation(void);
|
||||
float fade(float t);
|
||||
float lerp(float a, float b, float t);
|
||||
float grad(int hash, float x, float y);
|
||||
[[nodiscard]] const float fade(float t);
|
||||
[[nodiscard]] const float lerp(float a, float b, float t);
|
||||
[[nodiscard]] const float grad2D(int hash, float x, float y);
|
||||
[[nodiscard]] const float grad(int hash, float x, float y, float z);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user