mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'random_sub_uv' particle setting
This commit is contained in:
parent
c8187c5f25
commit
86b83a5377
5 changed files with 31 additions and 2 deletions
|
|
@ -67,7 +67,16 @@ void Emitter::update(
|
|||
particle.emitter = this;
|
||||
particle.random = random.rand32();
|
||||
particle.position = position;
|
||||
particle.lifetime *= 1.0f - preset.lifetimeSpread * random.randFloat();
|
||||
particle.velocity += glm::ballRand(1.0f) * preset.explosion;
|
||||
if (preset.randomSubUV < 1.0f) {
|
||||
particle.region.autoSub(
|
||||
preset.randomSubUV,
|
||||
preset.randomSubUV,
|
||||
random.randFloat(),
|
||||
random.randFloat()
|
||||
);
|
||||
}
|
||||
particles.push_back(std::move(particle));
|
||||
timer -= spawnInterval;
|
||||
if (count > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue