Noise.hpp
Go to the documentation of this file.
1 
7 #include <etk/types.hpp>
8 
9 #pragma once
10 
11 #include <etk/math/Vector2D.hpp>
12 
13 namespace etk {
19  class BaseNoise {
20  private:
21  std::vector<float> m_data;
22  ivec2 m_size;
23  public:
30  BaseNoise(const ivec2& _size, float _min, float _max);
37  float get(int32_t _x, int32_t _y) const;
38  };
43  enum noiseType {
51  };
57  class Noise {
58  private:
59  std::vector<float> m_data;
60  ivec2 m_size;
61  enum noiseType m_type;
62 
69  float smoothNoise(float _x, float _y, const etk::BaseNoise& _noise);
78  float turbulence(float _x, float _y, float _size, const etk::BaseNoise& _noise);
87  float turbulenceNoSmooth(float _x, float _y, float _size, const etk::BaseNoise& _noise);
88  public:
95  Noise(enum noiseType _type, ivec2 _size, int32_t _depth);
102  float get(int32_t _x, int32_t _y) const;
103  };
104 }
105 
Noise like a cloud.
Definition: Noise.hpp:48
basic random noise
Definition: Noise.hpp:44
Noise basic interface.
Definition: Noise.hpp:57
Noise like marble.
Definition: Noise.hpp:49
basic namespace of the etk library. (it might contain all the etk fuctions/class/structures without m...
Definition: Archive.hpp:16
Noise smoothed.
Definition: Noise.hpp:45
Noise Turbulence with no smooth apply.
Definition: Noise.hpp:47
noiseType
List of noise type supported.
Definition: Noise.hpp:43
Noise like wood.
Definition: Noise.hpp:50
Noise in turbulence mode.
Definition: Noise.hpp:46
BaseNoise Noise basic data.
Definition: Noise.hpp:19
BaseNoise(const ivec2 &_size, float _min, float _max)
basic constructor with randon settings