]> git.localhorst.tv Git - blank.git/blob - src/noise.hpp
move human I/O related stuff into separate file
[blank.git] / src / noise.hpp
1 #ifndef BLANK_NOISE_HPP_
2 #define BLANK_NOISE_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);
14
15         float operator ()(const glm::vec3 &) const;
16
17 private:
18         unsigned char Perm(size_t idx) const;
19         const glm::vec3 &Grad(size_t idx) const;
20
21 private:
22         unsigned char perm[512];
23         glm::vec3 grad[12];
24
25 };
26
27 }
28
29 #endif