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