mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user