Coverage report for gui


src/
File: src/utils/PerlinNoise.hpp
Date: 2024-06-25 10:57:02
Lines:
0/4
0.0%
Functions:
0/1
0.0%
Branches:
0/4
0.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2024
3 ** zappy
4 ** File description:
5 ** PerlinNoise
6 */
7
8 #ifndef PERLINNOISE_HPP_
9 #define PERLINNOISE_HPP_
10
11 #include <vector>
12 #include <cmath>
13 #include <algorithm>
14 #include <numeric>
15 #include <random>
16
17 class PerlinNoise {
18 public:
19
20 PerlinNoise(unsigned int seed = std::random_device{}()) {
21 initPermutationVector(seed);
22 }
23 ~PerlinNoise() {};
24
25 float noise(float x, float y);
26 float fade(float t);
27
28 float lerp(float t, float a, float b);
29
30 float grad(int hash, float x, float y);
31 protected:
32 private:
33 std::vector<int> _p;
34 void initPermutationVector(unsigned int seed);
35 };
36
37 #endif /* !PERLINNOISE_HPP_ */
38