Fixing zoom range bug
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 44s
Deploy Promiscuity Locations API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 8s

This commit is contained in:
Zeeshaun 2026-03-06 12:38:14 -06:00
parent 0a8cf20de9
commit a689b75651

View File

@ -11,8 +11,8 @@ const ACCELLERATION := 30.0
const DECELLERATION := 40.0 const DECELLERATION := 40.0
const JUMP_SPEED := 4.0 const JUMP_SPEED := 4.0
const MAX_NUMBER_OF_JUMPS := 2 const MAX_NUMBER_OF_JUMPS := 2
const MIN_FOV := 10 const MIN_FOV := 10.0
const MAX_FOV := 180 const MAX_FOV := 179.0
const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1 const ZOOM_FACTOR := 1.1 # Zoom out when >1, in when < 1
var mouse_sensitivity := 0.005 var mouse_sensitivity := 0.005
var rotation_x := 0.0 var rotation_x := 0.0
@ -187,6 +187,8 @@ func _input(event):
_flashlight.visible = !_flashlight.visible _flashlight.visible = !_flashlight.visible
func zoom_camera(factor): func zoom_camera(factor):
if cam == null:
return
var new_fov = cam.fov * factor var new_fov = cam.fov * factor
cam.fov = clamp(new_fov, MIN_FOV, MAX_FOV) cam.fov = clamp(new_fov, MIN_FOV, MAX_FOV)