add particles lighting

This commit is contained in:
MihailRis
2024-11-03 02:23:37 +03:00
parent b944f257f7
commit 7abb1a88c7
10 changed files with 66 additions and 26 deletions
+4 -1
View File
@@ -39,11 +39,14 @@ void Emitter::update(float delta, std::vector<Particle>& particles) {
// spawn particle
Particle particle = prototype;
particle.emitter = this;
particle.random = rand();
particle.position = position;
particle.velocity += glm::ballRand(1.0f) * explosion;
particles.push_back(std::move(particle));
timer -= spawnInterval;
count--;
if (count > 0) {
count--;
}
}
}