mirror of
https://github.com/godotengine/godot.git
synced 2025-01-26 04:22:30 -05:00
Merge pull request #26859 from JFonS/fix_cpuparticles_resetting
Fix resetting of CPUParticles (2D and 3D)
This commit is contained in:
commit
7052ddd706
2 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue