mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-04-10 06:14:07 +08:00
16 lines
368 B
C++
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);
|
|
}; |