]> git.localhorst.tv Git - blank.git/blob - src/rand/SimplexNoise.hpp
glm backwards compatibility
[blank.git] / src / rand / SimplexNoise.hpp
1 #ifndef BLANK_RAND_SIMPLEXNOISE_HPP_
2 #define BLANK_RAND_SIMPLEXNOISE_HPP_
3
4 #include "../graphics/glm.hpp"
5
6 #include <cstdint>
7
8
9 namespace blank {
10
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         glm::ivec3 second_ints[8];
28         glm::ivec3 third_ints[8];
29         glm::vec3 second_floats[8];
30         glm::vec3 third_floats[8];
31
32 };
33
34 }
35
36 #endif