mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add particles lighting
This commit is contained in:
parent
b944f257f7
commit
7abb1a88c7
10 changed files with 66 additions and 26 deletions
|
|
@ -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--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue