Skip to content

Commit 7be9852

Browse files
committed
Merge pull request #100977 from aaronp64/cpu_particles_scaling
Fix `CPUParticles2D` repeatedly scaling particles with 0 velocity and Align Y
2 parents d36f394 + 7f60546 commit 7be9852

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scene/2d/cpu_particles_2d.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,10 +1097,11 @@ void CPUParticles2D::_particles_process(double p_delta) {
10971097

10981098
if (particle_flags[PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY]) {
10991099
if (p.velocity.length() > 0.0) {
1100-
p.transform.columns[1] = p.velocity.normalized();
1101-
p.transform.columns[0] = p.transform.columns[1].orthogonal();
1100+
p.transform.columns[1] = p.velocity;
11021101
}
11031102

1103+
p.transform.columns[1] = p.transform.columns[1].normalized();
1104+
p.transform.columns[0] = p.transform.columns[1].orthogonal();
11041105
} else {
11051106
p.transform.columns[0] = Vector2(Math::cos(p.rotation), -Math::sin(p.rotation));
11061107
p.transform.columns[1] = Vector2(Math::sin(p.rotation), Math::cos(p.rotation));

0 commit comments

Comments
 (0)