refactor(effects): renombra temps_vida/temps_max a elapsed_time/max_lifetime

This commit is contained in:
2026-05-24 07:59:14 +02:00
parent 807f71ffa7
commit 4cfad053f0
6 changed files with 92 additions and 92 deletions
+4 -4
View File
@@ -102,7 +102,7 @@ namespace Effects {
fw->max_length = Defaults::FX::Firework::MAX_LENGTH;
fw->grow_duration = Defaults::FX::Firework::GROW_DURATION;
fw->temps_vida = 0.0F;
fw->elapsed_time = 0.0F;
fw->initial_speed = SPEED;
fw->brightness = initial_brightness;
@@ -119,7 +119,7 @@ namespace Effects {
continue;
}
fw.temps_vida += delta_time;
fw.elapsed_time += delta_time;
// 1. Fricció lineal (aplicar en la direcció del movement).
const float SPEED = std::sqrt(
@@ -144,9 +144,9 @@ namespace Effects {
bounceOffPlayArea(fw.head, fw.velocity);
// 4. Calcular longitud i brillor segons fase.
if (fw.temps_vida < fw.grow_duration) {
if (fw.elapsed_time < fw.grow_duration) {
// Fase 1: creixement lineal de 0 a max_length.
const float T = fw.temps_vida / fw.grow_duration;
const float T = fw.elapsed_time / fw.grow_duration;
fw.current_length = fw.max_length * T;
fw.brightness = Defaults::FX::Firework::INITIAL_BRIGHTNESS;
} else {