diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-03-10 11:09:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-10 11:09:36 +0100 |
commit | 7052ddd706d516c404664459a3bc92f74bd91baa (patch) | |
tree | fd3b9d500b104424b6fbd3ff91ecd183a3ee514b /scene | |
parent | 43184375b2340d6a00aa0087087ad039cf791e91 (diff) | |
parent | c13ac398f68ac1c16967ea2ffdfaf7cc854f76a8 (diff) |
Merge pull request #26859 from JFonS/fix_cpuparticles_resetting
Fix resetting of CPUParticles (2D and 3D)
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 6 | ||||
-rw-r--r-- | scene/3d/cpu_particles.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 4fafbd05f0..05c2253a5b 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -574,7 +574,7 @@ void CPUParticles2D::_particles_process(float p_delta) { if (restart_time >= prev_time && restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } @@ -582,13 +582,13 @@ void CPUParticles2D::_particles_process(float p_delta) { if (restart_time >= prev_time) { restart = true; if (fractional_delta) { - local_delta = (lifetime - restart_time + time) * lifetime; + local_delta = lifetime - restart_time + time; } } else if (restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } } diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index fc2e5c9b0d..85bc2dd529 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -544,7 +544,7 @@ void CPUParticles::_particles_process(float p_delta) { if (restart_time >= prev_time && restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } @@ -552,13 +552,13 @@ void CPUParticles::_particles_process(float p_delta) { if (restart_time >= prev_time) { restart = true; if (fractional_delta) { - local_delta = (1.0 - restart_time + time) * lifetime; + local_delta = lifetime - restart_time + time; } } else if (restart_time < time) { restart = true; if (fractional_delta) { - local_delta = (time - restart_time) * lifetime; + local_delta = time - restart_time; } } } |