feat(title-3d): horitzó ampliat (starfield Z=1500, naus exiting travessen el VP)
This commit is contained in:
@@ -18,10 +18,17 @@ namespace Title {
|
||||
// 0.0F → emet només la silueta plana. >0 emet volum extrudit.
|
||||
constexpr float SHIP_EXTRUSION_DEPTH = 1.0F;
|
||||
|
||||
// Punt de fuga (al fons, centre projectat). Tots els paths convergeixen aquí.
|
||||
// VP lògic per definir forward_dir / direcció del path. Tots els paths
|
||||
// s'allunyen cap a aquest punt; les naus exiting continuen MÉS ENLLÀ
|
||||
// (vegeu SHIP_EXIT_TRAVEL) per no desaparèixer en arribar al VP.
|
||||
constexpr float SHIP_EXIT_Z = 800.0F;
|
||||
constexpr Vec3 VANISHING_POINT{.x = 0.0F, .y = 0.0F, .z = SHIP_EXIT_Z};
|
||||
|
||||
// Distància que la nau recorre durant EXITING, sumada al forward_dir
|
||||
// sobre la posició inicial de l'exit. La nau travessa el VP i continua
|
||||
// allunyant-se per perspectiva fins gairebé desaparèixer per mida.
|
||||
constexpr float SHIP_EXIT_TRAVEL = 2500.0F;
|
||||
|
||||
// Directors VP → origen de cada nau, normalitzats. P1 ve des de "les 7"
|
||||
// del rellotge (baix-esquerra), P2 des de "les 5" (baix-dreta). Els
|
||||
// components estan calibrats perquè a TARGET_DIST el pixel projectat
|
||||
@@ -80,7 +87,7 @@ namespace Title {
|
||||
constexpr float SHIP_FLOAT_SCALE = 2.0F;
|
||||
constexpr float SHIP_ENTRY_SCALE = 2.0F; // Mida mundial idèntica; la perspectiva fa la resta
|
||||
constexpr float ENTRY_DURATION = 2.0F;
|
||||
constexpr float EXIT_DURATION = 1.0F;
|
||||
constexpr float EXIT_DURATION = 1.5F;
|
||||
|
||||
// Oscil·lació en unitats mundials (al voltant del target_position).
|
||||
constexpr float FLOAT_AMPLITUDE_X = 1.5F;
|
||||
@@ -276,10 +283,17 @@ namespace Title {
|
||||
const float PROGRESS = std::min(1.0F, ship.state_time / EXIT_DURATION);
|
||||
const float EASED = Easing::easeInQuad(PROGRESS);
|
||||
|
||||
// Vola cap al centre projectat (x=0, y=0) i a Z gran (lluny).
|
||||
ship.current_position.x = Easing::lerp(ship.initial_position.x, 0.0F, EASED);
|
||||
ship.current_position.y = Easing::lerp(ship.initial_position.y, 0.0F, EASED);
|
||||
ship.current_position.z = Easing::lerp(ship.initial_position.z, SHIP_EXIT_Z, EASED);
|
||||
// Destí: forward_dir prolongat des de l'inici de l'exit. La nau
|
||||
// segueix la mateixa línia recta (mateix path), travessa el VP i
|
||||
// continua allunyant-se fins a la mida visual ~0.
|
||||
const Vec3 EXIT_DEST{
|
||||
.x = ship.initial_position.x + (ship.forward_dir.x * SHIP_EXIT_TRAVEL),
|
||||
.y = ship.initial_position.y + (ship.forward_dir.y * SHIP_EXIT_TRAVEL),
|
||||
.z = ship.initial_position.z + (ship.forward_dir.z * SHIP_EXIT_TRAVEL),
|
||||
};
|
||||
ship.current_position.x = Easing::lerp(ship.initial_position.x, EXIT_DEST.x, EASED);
|
||||
ship.current_position.y = Easing::lerp(ship.initial_position.y, EXIT_DEST.y, EASED);
|
||||
ship.current_position.z = Easing::lerp(ship.initial_position.z, EXIT_DEST.z, EASED);
|
||||
ship.current_scale = ship.target_scale; // L'escala visual baixa via la perspectiva
|
||||
|
||||
if (PROGRESS >= 1.0F) {
|
||||
|
||||
Reference in New Issue
Block a user