]> git.localhorst.tv Git - tacos.git/blob - src/rand/SimplexNoise.hpp
basic floor idea
[tacos.git] / src / rand / SimplexNoise.hpp
1 #ifndef TACOS_RAND_SIMPLEXNOISE_HPP_
2 #define TACOS_RAND_SIMPLEXNOISE_HPP_
3
4 #include <cstdint>
5 #include <glm/glm.hpp>
6
7
8 namespace tacos {
9
10 class SimplexNoise {
11
12 public:
13         explicit SimplexNoise(std::uint64_t 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         glm::ivec3 second_ints[8];
27         glm::ivec3 third_ints[8];
28         glm::vec3 second_floats[8];
29         glm::vec3 third_floats[8];
30
31 };
32
33 }
34
35 #endif