mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-15 09:05:52 +00:00
Particle RandomScale is now cumulative and doesn't break interpolated scaling
Don't allocate interpolation data for RandomRotationRange when not needed Hope this commit doesn't break some visuals; i'm not 100% sure. Some particle files may rely on this behavior to look as intended.
This commit is contained in:
parent
3a40506ddb
commit
7b442174c8
1 changed files with 5 additions and 7 deletions
|
@ -110,22 +110,20 @@ void Emitter::spawnParticle(float perc)
|
|||
p->pos += Vector(sinf(a)*finalRadius * data.randomSpawnMod.x, cosf(a)*finalRadius * data.randomSpawnMod.y);
|
||||
}
|
||||
|
||||
if (!(data.randomScale1 == 1 && data.randomScale1 == data.randomScale2))
|
||||
{
|
||||
// Legacy codepath -- breaks animated scaling
|
||||
float sz = lerp(data.randomScale1, data.randomScale2, rng.f01());
|
||||
p->scale = Vector(sz,sz);
|
||||
p->scale *= sz;
|
||||
if(p->scale.data)
|
||||
p->scale.data->target *= sz;
|
||||
}
|
||||
|
||||
|
||||
if (data.randomRotationRange > 0)
|
||||
{
|
||||
p->rot.z = rng.f01() * data.randomRotationRange;
|
||||
p->rot.ensureData()->target.z += p->rot.z;
|
||||
if(p->rot.data)
|
||||
p->rot.data->target.z += p->rot.z;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (data.randomVelocityMagnitude > 0)
|
||||
{
|
||||
float a = randAngle();
|
||||
|
|
Loading…
Add table
Reference in a new issue