-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparticlesystem.h
37 lines (30 loc) · 1.2 KB
/
particlesystem.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
#ifndef PARTICLESYSTEM_H
#define PARTICLESYSTEM_H
#include "componentdata.h"
#include <QOpenGLFunctions_4_1_Core>
/** Particle effect system.
* Note: Not implemented yet.
* @brief Particle effect system.
*/
class ParticleSystem : QOpenGLFunctions_4_1_Core
{
public:
ParticleSystem();
void updateParticles(const CameraComponent& camera, const std::vector<TransformComponent>& transforms,
const std::vector<ParticleComponent>& particles, float time = 0.f);
void updateParticle(const CameraComponent &camera, const TransformComponent& transform, const ParticleComponent& particles, float time = 0.f);
~ParticleSystem();
private:
static constexpr float quadvertices[]{
// Position // Color // UV
-1.f, -1.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f,
1.f, -1.f, 0.f, 0.f, 1.f, 0.f, 1.f, 0.f,
1.f, 1.f, 0.f, 0.f, 0.f, 1.f, 1.f, 1.f,
-1.f, -1.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f,
1.f, 1.f, 0.f, 0.f, 0.f, 1.f, 1.f, 1.f,
-1.f, 1.f, 0.f, 1.f, 1.f, 0.f, 0.f, 1.f
};
GLuint quadVAO, quadVBO;
std::shared_ptr<Shader> particleShader;
};
#endif // PARTICLESYSTEM_H