]> git.localhorst.tv Git - blank.git/blob - src/rand/SimplexNoise.hpp
store players in world save
[blank.git] / src / rand / SimplexNoise.hpp
1 #ifndef BLANK_RAND_SIMPLEXNOISE_HPP_
2 #define BLANK_RAND_SIMPLEXNOISE_HPP_
3
4 #include <cstdint>
5 #include <glm/glm.hpp>
6
7
8 namespace blank {
9
10 /// (3D only) adaptation of Stefan Gustavson's SimplexNoise java class
11 class SimplexNoise {
12
13 public:
14         explicit SimplexNoise(std::uint64_t seed) noexcept;
15
16         float operator ()(const glm::vec3 &) const noexcept;
17
18 private:
19         int Perm(int idx) const noexcept;
20         int Perm12(int idx) const noexcept;
21         const glm::vec3 &Grad(int idx) const noexcept;
22
23 private:
24         int perm[512];
25         int perm12[512];
26         glm::vec3 grad[12];
27
28 };
29
30 }
31
32 #endif