fix(title-3d): naus rotades cap al VP, alçada mínima, eix X de càmera corregit

This commit is contained in:
2026-05-22 09:11:26 +02:00
parent b654fd0428
commit e533387ce5
2 changed files with 13 additions and 6 deletions
+6 -4
View File
@@ -49,10 +49,12 @@ namespace Graphics {
void Camera3D::recomputeBasis() {
// Forward = del position cap al target.
forward_ = (target_ - position_).normalized();
// Right = forward × up_world. Cau a (1,0,0) si forward ≈ up_world.
right_ = forward_.cross(up_world_).normalized();
// Up real ortogonal = right × forward.
up_ = right_.cross(forward_).normalized();
// Right = up_world × forward (convenció right-handed amb Y up,
// mirant cap a +Z → right cau a +X). L'invers (forward × up_world)
// donava la base mirall i invertia l'eix X de la projecció.
right_ = up_world_.cross(forward_).normalized();
// Up ortogonal real = forward × right (manté la mà dreta).
up_ = forward_.cross(right_).normalized();
}
void Camera3D::recomputeFocal() {