refactor(effects): renombra temps_vida/temps_max a elapsed_time/max_lifetime
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user