Merge pull request #26859 from JFonS/fix_cpuparticles_resetting

Fix resetting of CPUParticles (2D and 3D)
This commit is contained in:
Rémi Verschelde 2019-03-10 11:09:36 +01:00 committed by GitHub
commit 7052ddd706
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -574,7 +574,7 @@ void CPUParticles2D::_particles_process(float p_delta) {
if (restart_time >= prev_time && restart_time < time) { if (restart_time >= prev_time && restart_time < time) {
restart = true; restart = true;
if (fractional_delta) { 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) { if (restart_time >= prev_time) {
restart = true; restart = true;
if (fractional_delta) { if (fractional_delta) {
local_delta = (lifetime - restart_time + time) * lifetime; local_delta = lifetime - restart_time + time;
} }
} else if (restart_time < time) { } else if (restart_time < time) {
restart = true; restart = true;
if (fractional_delta) { if (fractional_delta) {
local_delta = (time - restart_time) * lifetime; local_delta = time - restart_time;
} }
} }
} }

View File

@ -544,7 +544,7 @@ void CPUParticles::_particles_process(float p_delta) {
if (restart_time >= prev_time && restart_time < time) { if (restart_time >= prev_time && restart_time < time) {
restart = true; restart = true;
if (fractional_delta) { 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) { if (restart_time >= prev_time) {
restart = true; restart = true;
if (fractional_delta) { if (fractional_delta) {
local_delta = (1.0 - restart_time + time) * lifetime; local_delta = lifetime - restart_time + time;
} }
} else if (restart_time < time) { } else if (restart_time < time) {
restart = true; restart = true;
if (fractional_delta) { if (fractional_delta) {
local_delta = (time - restart_time) * lifetime; local_delta = time - restart_time;
} }
} }
} }