-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBoidCloud.h
53 lines (42 loc) · 951 Bytes
/
BoidCloud.h
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
47
48
49
50
51
52
53
//
// Created by Garret on 1/8/2023.
//
#ifndef HEATMAP_BOIDCLOUD_H
#define HEATMAP_BOIDCLOUD_H
#include <vector>
#include "Shader.h"
#include "glad/gl.h"
#include "glm/vec3.hpp"
/// Draws a cloud of boid-like triangles according to the parameters given.
class BoidCloud {
public:
BoidCloud();
~BoidCloud();
struct BoidParams {
int quantity;
float scale;
glm::vec3 boundingVolume;
float minimumSpeed;
float maximumSpeed;
};
void setBoidParameters(const BoidParams ¶ms);
void draw();
void update();
private:
struct Boid {
glm::vec3 position;
glm::vec3 direction;
float speed;
};
std::vector<Boid> boids;
BoidParams params;
unsigned int textureId;
unsigned int vao;
unsigned int vbo;
unsigned int ebo;
Shader shader;
GLint modelId;
GLint viewId;
GLint projectionId;
};
#endif //HEATMAP_BOIDCLOUD_H