Compare commits
No commits in common. "ca898b0d094fd2c0cfb8c33d11b00502c7c0ba3a" and "4256b2001fbc181433654de9c94156ecf26e7e9c" have entirely different histories.
ca898b0d09
...
4256b2001f
@ -9,9 +9,6 @@ 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 MAX_FOV := 180
|
|
||||||
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
|
||||||
var rotation_y := 0.0
|
var rotation_y := 0.0
|
||||||
@ -89,14 +86,3 @@ func _input(event):
|
|||||||
|
|
||||||
$Camera3D.rotation.x = rotation_x
|
$Camera3D.rotation.x = rotation_x
|
||||||
rotation.y = rotation_y
|
rotation.y = rotation_y
|
||||||
|
|
||||||
if event is InputEventMouseButton and event.pressed:
|
|
||||||
if event.button_index == MOUSE_BUTTON_WHEEL_UP:
|
|
||||||
zoom_camera(1.0 / ZOOM_FACTOR) # Zoom in
|
|
||||||
elif event.button_index == MOUSE_BUTTON_WHEEL_DOWN:
|
|
||||||
zoom_camera(ZOOM_FACTOR) # Zoom out
|
|
||||||
|
|
||||||
func zoom_camera(factor):
|
|
||||||
var new_fov = cam.fov * factor
|
|
||||||
cam.fov = clamp(new_fov, MIN_FOV, MAX_FOV)
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user