]> git.localhorst.tv Git - blobs.git/blob - src/rand/SimplexNoise.hpp
fix return value of tsr get double
[blobs.git] / src / rand / SimplexNoise.hpp
1 #ifndef BLOBS_RAND_SIMPLEXNOISE_HPP_
2 #define BLOBS_RAND_SIMPLEXNOISE_HPP_
3
4 #include "../graphics/glm.hpp"
5
6 #include <cstdint>
7
8
9 namespace blobs {
10 namespace rand {
11
12 class SimplexNoise {
13
14 public:
15         explicit SimplexNoise(std::uint64_t seed) noexcept;
16
17         float operator ()(const glm::vec3 &) const noexcept;
18
19 private:
20         int Perm(int idx) const noexcept;
21         int Perm12(int idx) const noexcept;
22         const glm::vec3 &Grad(int idx) const noexcept;
23
24 private:
25         int perm[512];
26         int perm12[512];
27         glm::vec3 grad[12];
28         glm::ivec3 second_ints[8];
29         glm::ivec3 third_ints[8];
30         glm::vec3 second_floats[8];
31         glm::vec3 third_floats[8];
32
33 };
34
35 }
36 }
37
38 #endif