1
0
Fork 0

Merge pull request #100977 from aaronp64/cpu_particles_scaling

Fix `CPUParticles2D` repeatedly scaling particles with 0 velocity and Align Y
This commit is contained in:
Thaddeus Crews 2025-07-10 11:39:32 -05:00
commit 7be9852948
No known key found for this signature in database
GPG Key ID: 8C6E5FEB5FC03CCC
1 changed files with 3 additions and 2 deletions

View File

@ -1097,10 +1097,11 @@ void CPUParticles2D::_particles_process(double p_delta) {
if (particle_flags[PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY]) {
if (p.velocity.length() > 0.0) {
p.transform.columns[1] = p.velocity.normalized();
p.transform.columns[0] = p.transform.columns[1].orthogonal();
p.transform.columns[1] = p.velocity;
}
p.transform.columns[1] = p.transform.columns[1].normalized();
p.transform.columns[0] = p.transform.columns[1].orthogonal();
} else {
p.transform.columns[0] = Vector2(Math::cos(p.rotation), -Math::sin(p.rotation));
p.transform.columns[1] = Vector2(Math::sin(p.rotation), Math::cos(p.rotation));