blob: f585a81e7395f0d3ffb0b0c72b1f02c29b1eb670 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "Particle.h"
#include "ParticleEmitter.h"
using namespace crepe;
ParticleEmitter::ParticleEmitter(uint32_t game_object_id, const ParticleEmitterData& data) : Component(game_object_id),data(data) {
for (size_t i = 0; i < this->data.max_particles; i++) {
this->data.particles.emplace_back();
}
}
ParticleEmitter::~ParticleEmitter() {
std::vector<Particle>::iterator it = this->data.particles.begin();
while (it != this->data.particles.end()) {
it = this->data.particles.erase(it);
}
}
|