feat: add perlin noise

This commit is contained in:
2026-04-05 18:21:43 +08:00
parent 5ce0810294
commit 23affb78b5
10 changed files with 150 additions and 15 deletions

View File

@@ -0,0 +1,16 @@
#pragma once
#include <vector>
class PerlinNoise {
public:
static void init();
static float noise(float x, float y, float z);
private:
static inline bool is_init = false;
static inline std::vector<int> p;
static float fade(float t);
static float lerp(float t, float a, float b);
static float grad(int hash, float x, float y, float z);
};