feat(*): Add bot selection, score HUD, and winner reveal to matches, replace HUD text with aircraft-style flight instruments, and fix camera judder

This commit is contained in:
Josh Creek
2026-07-20 07:12:09 +01:00
parent 48369c50dc
commit 240e362f2f
20 changed files with 653 additions and 91 deletions
+6 -1
View File
@@ -70,7 +70,12 @@ func _update_ball_cam(delta, ball: Node3D):
var flat := Vector3(ship_pos.x - ball_pos.x, 0.0, ship_pos.z - ball_pos.z)
if flat.length() > 0.25:
var t := 1.0 - exp(-orbit_smoothing * delta) # frame-rate independent
_orbit_dir = _orbit_dir.slerp(flat.normalized(), t).normalized()
# Both directions are horizontal, so swing about the exact UP axis.
# (Vector3.slerp derives its axis from the cross product, which
# degenerates when the directions are nearly parallel — the common
# case here — and spams normalization errors every frame.)
var swing := _orbit_dir.signed_angle_to(flat.normalized(), Vector3.UP)
_orbit_dir = _orbit_dir.rotated(Vector3.UP, swing * t).normalized()
var camera_target_pos := ship_pos + _orbit_dir * camera_distance + Vector3.UP * camera_height
camera_target_pos.y = maxf(camera_target_pos.y, min_camera_height)