touch controls and hud
This commit is contained in:
@@ -42,6 +42,15 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
_user_fov = clamp(_user_fov * 1.1, fov_min, fov_max)
|
||||
|
||||
|
||||
# Pinch-to-zoom hook for the touch UI. `ratio` is the two-finger spread this frame over
|
||||
# last frame: >1 (fingers parting) narrows the FOV to zoom in, <1 widens it to pull back,
|
||||
# mirroring the scroll-wheel zoom_in/zoom_out feel.
|
||||
func adjust_zoom(ratio: float) -> void:
|
||||
if ratio <= 0.0:
|
||||
return
|
||||
_user_fov = clampf(_user_fov / ratio, fov_min, fov_max)
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
fov = lerpf(fov, _user_fov, delta * 8.0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user