-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParticleSystem.h
More file actions
54 lines (41 loc) · 894 Bytes
/
ParticleSystem.h
File metadata and controls
54 lines (41 loc) · 894 Bytes
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
#pragma once
#include <glm/glm.hpp>
#include "Shader.h"
#include "ShaderManager.hpp"
#include "Camera.h"
namespace Engine
{
class ParticleSystem
{
public:
ParticleSystem(glm::vec3 boundBoxMin, glm::vec3 boundBoxMax, float minVelocity, float maxVelocity);
void Update();
void Draw(Camera* cam);
private:
ComputeShader* cShader;
Shader* shader;
glm::vec3 m_boundBoxMin;
glm::vec3 m_boundBoxMax;
// need to do the following for both position, velocity, and colors of the particles:
GLuint posSSbo;
GLuint velSSbo;
GLuint colSSbo;
GLuint quadVAO, quadVBO;
struct pos
{
float x, y, z, w; // positions
};
struct vel
{
float vx, vy, vz, vw; // velocities
};
struct color
{
float r, g, b, a; // colors
};
struct pos* points;
float random(float min, float max) {
return min + (((rand() % 100) * 1.f) / 100.f) * max;
}
};
}