Files
Cubed/include/Cubed/tools/perlin_noise.hpp
2026-04-05 18:21:43 +08:00

16 lines
368 B
C++

#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);
};