Previewer: Ajout zoom via molette .
This commit is contained in:
parent
4d7dc2cc3a
commit
03f96ab78f
3 changed files with 20 additions and 5 deletions
|
@ -23,3 +23,8 @@ func _input(event):
|
||||||
$dummy/camera_stand/camera.rotate_x( -event.relative.y * 0.01 )
|
$dummy/camera_stand/camera.rotate_x( -event.relative.y * 0.01 )
|
||||||
$dummy/camera_stand.rotate_y( -event.relative.x * 0.01 )
|
$dummy/camera_stand.rotate_y( -event.relative.x * 0.01 )
|
||||||
|
|
||||||
|
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 )
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
[ext_resource path="res://previewer/previewer.gd" type="Script" id=1]
|
[ext_resource path="res://previewer/previewer.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://previewer/dummy/dummy.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://previewer/dummy/dummy.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://meshes/props/travel_box/container.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://meshes/props/pendo_teddy/pendo_teddy.tscn" type="PackedScene" id=3]
|
||||||
[ext_resource path="res://meshes/props/pendo_teddy/pendo_teddy.tscn" type="PackedScene" id=4]
|
[ext_resource path="res://meshes/props/travel_box/container.tscn" type="PackedScene" id=4]
|
||||||
|
|
||||||
[sub_resource type="ProceduralSky" id=1]
|
[sub_resource type="ProceduralSky" id=1]
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ mesh = SubResource( 6 )
|
||||||
|
|
||||||
[node name="props" type="Spatial" parent="."]
|
[node name="props" type="Spatial" parent="."]
|
||||||
|
|
||||||
[node name="pendo_teddy" parent="props" instance=ExtResource( 4 )]
|
[node name="pendo_teddy" parent="props" instance=ExtResource( 3 )]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -3 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -3 )
|
||||||
|
|
||||||
[node name="container" parent="props" instance=ExtResource( 3 )]
|
[node name="container" parent="props" instance=ExtResource( 4 )]
|
||||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5 )
|
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5 )
|
||||||
|
|
||||||
[node name="light_system" type="Spatial" parent="."]
|
[node name="light_system" type="Spatial" parent="."]
|
||||||
|
|
|
@ -46,6 +46,16 @@ move_look={
|
||||||
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
|
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
move_zoom_out={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":5,"pressed":false,"doubleclick":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
move_zoom_in={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":4,"pressed":false,"doubleclick":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[node]
|
[node]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue