2019-04-19 10:27:07 +00:00
|
|
|
extends Spatial
|
|
|
|
|
|
|
|
func _process( delta ):
|
2019-04-26 08:36:37 +00:00
|
|
|
|
|
|
|
if Input.is_action_pressed("move_up"):
|
|
|
|
$dummy/camera_stand.translate( Vector3( 0.0, 10.0*delta, 0.0 ) )
|
|
|
|
elif Input.is_action_pressed("move_down"):
|
|
|
|
$dummy/camera_stand.translate( Vector3( 0.0,-10.0*delta, 0.0 ) )
|
|
|
|
elif Input.is_action_pressed("move_forward"):
|
2019-04-19 10:27:07 +00:00
|
|
|
$dummy/camera_stand.translate( Vector3( 0.0, 0.0,-10.0*delta ) )
|
2019-04-26 08:36:37 +00:00
|
|
|
elif Input.is_action_pressed("move_backward"):
|
2019-04-19 10:27:07 +00:00
|
|
|
$dummy/camera_stand.translate( Vector3( 0.0, 0.0, 10.0*delta ) )
|
2019-04-26 08:36:37 +00:00
|
|
|
elif Input.is_action_pressed("move_left"):
|
2019-04-25 20:38:32 +00:00
|
|
|
$dummy/camera_stand.translate( Vector3(-10.0*delta, 0.0, 0.0 ) )
|
2019-04-26 08:36:37 +00:00
|
|
|
elif Input.is_action_pressed("move_right"):
|
2019-04-25 20:38:32 +00:00
|
|
|
$dummy/camera_stand.translate( Vector3( 10.0*delta, 0.0, 0.0 ) )
|
|
|
|
|
|
|
|
func _input(event):
|
|
|
|
|
|
|
|
if event.is_action_pressed( "move_look" ):
|
|
|
|
Input.set_mouse_mode( Input.MOUSE_MODE_CAPTURED )
|
|
|
|
elif event.is_action_released( "move_look" ):
|
|
|
|
Input.set_mouse_mode( Input.MOUSE_MODE_VISIBLE )
|
|
|
|
|
|
|
|
if event is InputEventMouseMotion:
|
|
|
|
if Input.is_action_pressed( "move_look" ):
|
|
|
|
$dummy/camera_stand/camera.rotate_x( -event.relative.y * 0.01 )
|
|
|
|
$dummy/camera_stand.rotate_y( -event.relative.x * 0.01 )
|
2019-04-25 20:48:24 +00:00
|
|
|
|
|
|
|
if event.is_action_pressed( "move_zoom_in" ):
|
|
|
|
$dummy/camera_stand/camera.set_fov( $dummy/camera_stand/camera.get_fov()-1.0 )
|
|
|
|
elif event.is_action_pressed( "move_zoom_out" ):
|
|
|
|
$dummy/camera_stand/camera.set_fov( $dummy/camera_stand/camera.get_fov()+1.0 )
|
|
|
|
|