-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlowField.hpp
46 lines (34 loc) · 927 Bytes
/
FlowField.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* FlowField.hpp
*
* Created on: 24 paź 2019
* Author: kwarc
*/
#ifndef FLOWFIELD_HPP_
#define FLOWFIELD_HPP_
#include <SFML/Graphics.hpp>
#include <PerlinNoise.hpp>
class FlowField : public sf::Drawable, public sf::Transformable
{
public:
FlowField(unsigned int width, unsigned int height, float scale, sf::Color color, bool show);
const std::vector<sf::Vector2f> & generate();
float getScale() const;
private:
bool show;
float scale;
unsigned int width, height;
unsigned int cellWidth, cellHeight;
std::vector<sf::Vector2f> flowfield;
std::vector<sf::RectangleShape> vectors;
struct dimensions
{
float x, y, z;
};
struct dimensions noiseDimensions;
PerlinNoise noiseGenerator;
// methods
float calculateAngle(void);
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
};
#endif /* FLOWFIELD_HPP_ */