Fixing zoom range bug
All checks were successful
All checks were successful
This commit is contained in:
parent
0a8cf20de9
commit
a689b75651
@ -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)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user