From da869e01851ac85016188c903028c538e751c398 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 10 Feb 2024 00:10:51 +0100 Subject: [PATCH] Improved camera --- client/Main.tscn | 19 +---- client/camera/Camera.gd | 60 ++++++--------- client/camera/Camera.tscn | 23 ++++++ client/camera/CameraPivot.gd | 26 +++++++ client/camera/CameraShake.gd | 26 +++++++ client/camera/FollowPlayer.gd | 14 ++++ client/controller/PlayerController.gd | 2 +- client/player/Player.tscn | 101 +++++++++++++------------- client/project.godot | 32 +++++--- client/world/CameraPractical.tres | 5 +- 10 files changed, 194 insertions(+), 114 deletions(-) create mode 100644 client/camera/Camera.tscn create mode 100644 client/camera/CameraPivot.gd create mode 100644 client/camera/CameraShake.gd create mode 100644 client/camera/FollowPlayer.gd diff --git a/client/Main.tscn b/client/Main.tscn index 1e328b1..375cb70 100644 --- a/client/Main.tscn +++ b/client/Main.tscn @@ -12,6 +12,7 @@ [ext_resource type="Script" path="res://network/PlayerJump.gd" id="9_o8sk8"] [ext_resource type="Script" path="res://network/Chat.gd" id="10_y3len"] [ext_resource type="Script" path="res://world/Sun.gd" id="11_4jb08"] +[ext_resource type="PackedScene" uid="uid://cpdoq0oh84mfw" path="res://camera/Camera.tscn" id="12_aljdh"] [ext_resource type="Environment" uid="uid://dixa0yso2s1u3" path="res://world/Environment.tres" id="12_cscto"] [ext_resource type="PackedScene" uid="uid://hnn0n1xc2qt7" path="res://assets/tree/Tree.blend" id="14_7jtdl"] [ext_resource type="CameraAttributesPractical" uid="uid://b835orxyqq6w5" path="res://world/CameraPractical.tres" id="15_6h2nx"] @@ -19,7 +20,6 @@ [ext_resource type="Script" path="res://world/PlayerManager.gd" id="16_dp6bj"] [ext_resource type="PackedScene" uid="uid://dagn5bf7ou3sd" path="res://ui/UI.tscn" id="17_43qhq"] [ext_resource type="Material" uid="uid://bdsblfaxbipaa" path="res://world/grass/GrassMaterial.tres" id="18_tja64"] -[ext_resource type="Script" path="res://camera/Camera.gd" id="18_wogcj"] [ext_resource type="MultiMesh" uid="uid://dog5aq5n2q025" path="res://assets/grass/grass.multimesh" id="19_ae26a"] [ext_resource type="PackedScene" uid="uid://cm0rho6adv2p7" path="res://world/water/Water.tscn" id="20_bmo3k"] @@ -94,20 +94,7 @@ autostart = true [node name="World" type="Node3D" parent="."] -[node name="Follow" type="Node3D" parent="World"] - -[node name="Pivot" type="Marker3D" parent="World/Follow"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) - -[node name="Camera" type="Camera3D" parent="World/Follow/Pivot" node_paths=PackedStringArray("follow_node", "pivot_node")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.5, 7.5) -current = true -fov = 30.0 -size = 10.0 -far = 1000.0 -script = ExtResource("18_wogcj") -follow_node = NodePath("../..") -pivot_node = NodePath("..") +[node name="Follow" parent="World" instance=ExtResource("12_aljdh")] [node name="Environment" type="WorldEnvironment" parent="World"] environment = ExtResource("12_cscto") @@ -115,7 +102,7 @@ camera_attributes = ExtResource("15_6h2nx") [node name="Sun" type="DirectionalLight3D" parent="World/Environment"] transform = Transform3D(-0.350207, 0.827032, -0.439741, 0, 0.469472, 0.882948, 0.936672, 0.309215, -0.164412, 0, 3, 0) -light_energy = 2.0 +light_energy = 1.8 shadow_enabled = true script = ExtResource("11_4jb08") diff --git a/client/camera/Camera.gd b/client/camera/Camera.gd index 8f7e2ad..5c2225b 100644 --- a/client/camera/Camera.gd +++ b/client/camera/Camera.gd @@ -1,46 +1,32 @@ extends Camera3D -@export_group("Main") -@export var follow_node: Node3D -@export var pivot_node: Node3D +@export_group("Zoom") +@export var zoom_speed := 0.5 +@export var zoom_interpolation := 10.0 +@export var zoom_min := 2.0 +@export var zoom_max := 8.0 -@export_group("Follow") -@export var follow_enabled: bool -@export var follow_speed: float - -@export_group("Shake") -@export var shake_strength := 1.0 -@export var shake_decay := 0.8 -@export var shake_noise: Noise - -var trauma := 0.0 -var trauma_time := 0.0 +var target_distance: float func _ready(): + target_distance = position.z Global.camera = self +func _unhandled_input(event): + if event.is_action_pressed("zoom_in"): + target_distance -= zoom_speed + on_distance_changed() + + if event.is_action_pressed("zoom_out"): + target_distance += zoom_speed + on_distance_changed() + +func on_distance_changed(): + target_distance = clampf(target_distance, zoom_min, zoom_max) + Global.camera_attributes.dof_blur_far_distance = target_distance + 1.0 + func _process(delta): - if Global.player == null: + if abs(target_distance - position.z) < 0.01: return - - if follow_enabled: - follow_node.position = lerp(follow_node.position, Global.player.position, follow_speed * delta) - else: - follow_node.position = Global.player.position - - if trauma: - trauma = max(trauma - shake_decay * delta, 0) - trauma_time += 4096 * delta - _shake(trauma_time) - else: - look_at(pivot_node.global_position) - trauma_time = 0 - -func _shake(time): - var trauma_sq := trauma * trauma - rotation.x += shake_noise.get_noise_2d(time, 0) * trauma_sq * shake_strength - rotation.y += shake_noise.get_noise_2d(time, 1) * trauma_sq * shake_strength - rotation.z += shake_noise.get_noise_2d(time, 2) * trauma_sq * shake_strength - -func add_shake(amount: float): - trauma = min(trauma + amount, 1.0) + + position.z = lerpf(position.z, target_distance, zoom_interpolation * delta) \ No newline at end of file diff --git a/client/camera/Camera.tscn b/client/camera/Camera.tscn new file mode 100644 index 0000000..ad33c22 --- /dev/null +++ b/client/camera/Camera.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=4 format=3 uid="uid://cpdoq0oh84mfw"] + +[ext_resource type="Script" path="res://camera/FollowPlayer.gd" id="1_48rtd"] +[ext_resource type="Script" path="res://camera/CameraPivot.gd" id="2_dylfm"] +[ext_resource type="Script" path="res://camera/Camera.gd" id="2_pwdc2"] + +[node name="Follow" type="Marker3D"] +script = ExtResource("1_48rtd") +interpolate = true +speed = 10.0 + +[node name="Pivot" type="Marker3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4, 0) +script = ExtResource("2_dylfm") +sensitivity = 0.2 + +[node name="Camera" type="Camera3D" parent="Pivot"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 7.5) +current = true +fov = 45.0 +size = 10.0 +far = 1000.0 +script = ExtResource("2_pwdc2") diff --git a/client/camera/CameraPivot.gd b/client/camera/CameraPivot.gd new file mode 100644 index 0000000..7696897 --- /dev/null +++ b/client/camera/CameraPivot.gd @@ -0,0 +1,26 @@ +extends Node3D + +@export var sensitivity: float + +var enabled: bool + +func _ready(): + assert(rotation_order == EULER_ORDER_YXZ) + +func _unhandled_input(event): + if event.is_action_pressed("look"): + enabled = true + DisplayServer.mouse_set_mode(DisplayServer.MOUSE_MODE_CAPTURED) + + if event.is_action_released("look"): + enabled = false + DisplayServer.mouse_set_mode(DisplayServer.MOUSE_MODE_VISIBLE) + + if !enabled: + return + + if not event is InputEventMouseMotion: + return + + rotation.x += deg_to_rad(-event.relative.y * sensitivity) + rotation.y += deg_to_rad(-event.relative.x * sensitivity) diff --git a/client/camera/CameraShake.gd b/client/camera/CameraShake.gd new file mode 100644 index 0000000..34cfde0 --- /dev/null +++ b/client/camera/CameraShake.gd @@ -0,0 +1,26 @@ +extends Node3D + +@export var shake_strength := 1.0 +@export var shake_decay := 0.8 +@export var shake_noise: Noise + +var trauma := 0.0 +var trauma_time := 0.0 + +func _process(delta): + if trauma: + trauma = max(trauma - shake_decay * delta, 0) + trauma_time += 4096 * delta + _shake(trauma_time) + else: + rotation = Vector3.ZERO + trauma_time = 0 + +func _shake(time): + var trauma_sq := trauma * trauma + rotation.x += shake_noise.get_noise_2d(time, 0) * trauma_sq * shake_strength + rotation.y += shake_noise.get_noise_2d(time, 1) * trauma_sq * shake_strength + rotation.z += shake_noise.get_noise_2d(time, 2) * trauma_sq * shake_strength + +func add_shake(amount: float): + trauma = min(trauma + amount, 1.0) \ No newline at end of file diff --git a/client/camera/FollowPlayer.gd b/client/camera/FollowPlayer.gd new file mode 100644 index 0000000..71c5adc --- /dev/null +++ b/client/camera/FollowPlayer.gd @@ -0,0 +1,14 @@ +extends Node3D + +@export var interpolate: bool +@export var speed: float + +func _process(delta): + if Global.player == null: + return + + if interpolate: + position = lerp(position, Global.player.position, speed * delta) + else: + position = Global.player.position + diff --git a/client/controller/PlayerController.gd b/client/controller/PlayerController.gd index d81360c..55869f6 100644 --- a/client/controller/PlayerController.gd +++ b/client/controller/PlayerController.gd @@ -17,7 +17,7 @@ func _unhandled_input(event): # Calculate the direction var move := Input.get_vector("move_left", "move_right", "move_forward", "move_backward") - var direction := (Global.camera.transform.basis * Vector3(move.x, 0, move.y)) + var direction := (Global.camera.global_basis * Vector3(move.x, 0, move.y)) direction.y = 0 direction = direction.normalized() diff --git a/client/player/Player.tscn b/client/player/Player.tscn index fbd920a..d0ddc4c 100644 --- a/client/player/Player.tscn +++ b/client/player/Player.tscn @@ -24,68 +24,71 @@ script = ExtResource("1_8gebs") [node name="Female" parent="Model" instance=ExtResource("2_8nah6")] [node name="Armature" parent="Model/Female" index="0"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.000305099, -0.000408816) +transform = Transform3D(0.995541, 0.0478569, -0.0812847, -0.0469057, 0.998807, 0.0135727, 0.0818373, -0.00969949, 0.996599, -1.05381e-06, -0.00711502, 0.00603829) [node name="GeneralSkeleton" parent="Model/Female/Armature" index="0"] bones/1/rotation = Quaternion(1.10655e-09, -2.59221e-24, -2.34947e-16, 1) -bones/2/rotation = Quaternion(-2.64698e-23, 0, 0, 1) -bones/3/rotation = Quaternion(-7.45058e-09, -8.53484e-16, -4.44089e-16, 1) -bones/4/rotation = Quaternion(7.45058e-09, -2.08167e-17, -3.33067e-16, 1) -bones/11/rotation = Quaternion(2.98023e-08, -3.33067e-16, -1.77636e-15, 1) -bones/12/rotation = Quaternion(3.72529e-09, 3.59435e-15, -4.44089e-16, 1) +bones/2/rotation = Quaternion(0.0106127, 0.0061452, 0.0135454, 0.999833) +bones/3/rotation = Quaternion(0.0212324, 0.0124238, 0.0257363, 0.999366) +bones/4/rotation = Quaternion(0.0212324, 0.0124238, 0.0257363, 0.999366) +bones/11/rotation = Quaternion(-0.0226131, 0.000417995, -0.000782817, 0.999744) +bones/12/rotation = Quaternion(-0.0226131, 0.00041802, -0.00078283, 0.999744) bones/13/rotation = Quaternion(0.707107, -1.35146e-08, -1.15217e-08, 0.707107) bones/14/rotation = Quaternion(0.707107, -3.46447e-08, -1.09908e-09, 0.707107) -bones/16/rotation = Quaternion(-2.98023e-08, 1, -2.98023e-08, -2.98023e-08) -bones/17/rotation = Quaternion(2.10734e-08, -0.707107, 0, 0.707107) -bones/18/rotation = Quaternion(0.0288902, 0.701957, -0.0496415, 0.7099) -bones/19/rotation = Quaternion(-0.0554471, 0.00107706, 0.0246517, 0.998157) -bones/20/rotation = Quaternion(-0.0144301, 0.000280172, 0.00955668, 0.99985) -bones/21/rotation = Quaternion(-0.0029327, 0.000187874, -0.00258715, 0.999992) -bones/22/rotation = Quaternion(-0.055445, -3.27826e-07, 0.0149855, 0.998349) -bones/23/rotation = Quaternion(-1.49012e-08, 0, -2.98023e-08, 1) -bones/24/rotation = Quaternion(0.00776948, -4.76837e-07, -0.00960994, 0.999924) -bones/25/rotation = Quaternion(-0.0554483, -2.08616e-07, 0.0149855, 0.998349) -bones/26/rotation = Quaternion(0, 1.49012e-08, 0, 1) +bones/15/rotation = Quaternion(0.510354, 0.474272, 0.574676, -0.429363) +bones/16/rotation = Quaternion(0.147678, 0.83228, -0.516329, -0.137494) +bones/17/rotation = Quaternion(0.0523164, -0.710684, 0.051662, 0.699659) +bones/18/rotation = Quaternion(0.0442343, 0.580786, 0.176085, 0.793552) +bones/19/rotation = Quaternion(0.116694, -0.0625513, -0.104637, 0.985658) +bones/20/rotation = Quaternion(0.0989349, 0.00127378, -0.0100822, 0.995042) +bones/21/rotation = Quaternion(-2.98023e-08, -2.98023e-08, -2.98023e-08, 1) +bones/22/rotation = Quaternion(0.242606, 0.0443104, -0.0693371, 0.966629) +bones/23/rotation = Quaternion(0.142512, -0.00254311, 0.0231811, 0.989518) +bones/24/rotation = Quaternion(0, -1.19209e-07, 0, 1) +bones/25/rotation = Quaternion(0.0921014, -0.0103497, -0.0608265, 0.993836) +bones/26/rotation = Quaternion(0.0901785, 0.000219584, 0.0019213, 0.995924) bones/27/rotation = Quaternion(2.98023e-08, 2.98023e-08, 2.98023e-08, 1) -bones/28/rotation = Quaternion(-0.0554469, -2.98023e-07, 0.0149854, 0.998349) -bones/29/rotation = Quaternion(1.49012e-08, 2.98023e-08, 0, 1) -bones/30/rotation = Quaternion(-0.00621979, 1.93715e-07, 0.0114379, 0.999915) -bones/31/rotation = Quaternion(-0.0459777, 0.728478, 0.25833, 0.632828) -bones/32/rotation = Quaternion(-0.0219009, -0.00048776, 0.00526157, 0.999746) -bones/33/rotation = Quaternion(0.0390275, 0.000722662, -0.0124225, 0.999161) -bones/35/rotation = Quaternion(0, 1, 0, -5.96046e-08) -bones/36/rotation = Quaternion(0, 0.707107, 4.21468e-08, 0.707107) -bones/37/rotation = Quaternion(0.0288902, -0.701957, 0.0496415, 0.7099) -bones/38/rotation = Quaternion(-0.055447, -0.00107703, -0.0246517, 0.998157) -bones/39/rotation = Quaternion(-0.01443, -0.000280231, -0.0095567, 0.99985) -bones/40/rotation = Quaternion(-0.00293274, -0.000187755, 0.00258715, 0.999992) -bones/41/rotation = Quaternion(-0.055445, 2.98023e-07, -0.0149855, 0.998349) -bones/42/rotation = Quaternion(-4.47035e-08, 4.47035e-08, -1.49012e-08, 1) -bones/43/rotation = Quaternion(0.00776939, 5.0664e-07, 0.00960997, 0.999924) -bones/44/rotation = Quaternion(-0.0554483, 1.49012e-07, -0.0149856, 0.998349) -bones/45/rotation = Quaternion(1.49012e-08, -1.49012e-08, 1.49012e-08, 1) +bones/28/rotation = Quaternion(0.165154, 0.00884447, -0.0589361, 0.984466) +bones/29/rotation = Quaternion(0.090618, -0.00120631, -0.00193921, 0.995883) +bones/30/rotation = Quaternion(0, 1.49012e-08, 0, 1) +bones/31/rotation = Quaternion(-0.144124, 0.641731, 0.137562, 0.740599) +bones/32/rotation = Quaternion(0.0971556, 0.0306568, -0.0228636, 0.994534) +bones/33/rotation = Quaternion(-1.49012e-08, 1.49012e-08, 0, 1) +bones/34/rotation = Quaternion(0.512517, -0.475648, -0.551246, -0.455206) +bones/35/rotation = Quaternion(-0.141908, 0.820729, -0.511312, 0.21172) +bones/36/rotation = Quaternion(0.0614412, 0.713017, -0.0602652, 0.695845) +bones/37/rotation = Quaternion(-0.0543144, -0.48594, -0.218214, 0.844568) +bones/38/rotation = Quaternion(0.117855, 0.0630393, 0.0680784, 0.988687) +bones/39/rotation = Quaternion(0.0455891, 0.00111282, 0.00525612, 0.998946) +bones/40/rotation = Quaternion(0, 5.96046e-08, 0, 1) +bones/41/rotation = Quaternion(0.193312, -0.00678019, 0.0324385, 0.980578) +bones/42/rotation = Quaternion(0.109045, 0.0103536, -0.0347182, 0.993376) +bones/43/rotation = Quaternion(1.49012e-08, 7.45058e-08, -4.47035e-08, 1) +bones/44/rotation = Quaternion(0.119383, 0.00551496, 0.0545327, 0.991334) +bones/45/rotation = Quaternion(0.0908674, 0.000456899, -0.00333831, 0.995857) bones/46/rotation = Quaternion(0, -1.49012e-08, -1.49012e-08, 1) -bones/47/rotation = Quaternion(-0.0554468, 2.38419e-07, -0.0149854, 0.998349) -bones/48/rotation = Quaternion(0, -1.49012e-08, 0, 1) -bones/49/rotation = Quaternion(-0.0062138, -4.61936e-07, -0.011438, 0.999915) -bones/50/rotation = Quaternion(-0.0459777, -0.728478, -0.25833, 0.632828) -bones/51/rotation = Quaternion(-0.0219009, 0.000487968, -0.00526172, 0.999746) -bones/52/rotation = Quaternion(0.0390272, -0.000721872, 0.0124239, 0.999161) -bones/53/rotation = Quaternion(1.78359e-07, 0.00610319, 0.999981, 7.87824e-09) -bones/54/rotation = Quaternion(-1.15267e-08, 1, -0.000802423, -2.059e-07) -bones/55/rotation = Quaternion(-1.81421e-07, 0.710845, -0.703349, 2.42514e-07) -bones/56/rotation = Quaternion(4.97719e-14, 1, 0, 1.92336e-13) -bones/57/rotation = Quaternion(1.22635e-07, 0.00610348, 0.999981, 4.94272e-08) -bones/58/rotation = Quaternion(-5.5979e-08, 1, -0.000803839, -1.20528e-07) -bones/59/rotation = Quaternion(-1.8142e-07, 0.710844, -0.70335, 2.42513e-07) -bones/60/rotation = Quaternion(-1.28748e-14, 1, 0, 1.16815e-13) +bones/47/rotation = Quaternion(0.176473, 0.0112967, 0.0352683, 0.983609) +bones/48/rotation = Quaternion(0.0815352, 0.00364731, -0.0030745, 0.996659) +bones/49/rotation = Quaternion(0, 4.47035e-08, -4.47035e-08, 1) +bones/50/rotation = Quaternion(-0.137948, -0.61775, -0.121748, 0.764547) +bones/51/rotation = Quaternion(0.130968, -0.0275934, 0.00331908, 0.990997) +bones/52/rotation = Quaternion(-2.98023e-08, 0, -8.94069e-08, 1) +bones/53/rotation = Quaternion(0.0235545, 0.140936, 0.987094, -0.0723018) +bones/54/rotation = Quaternion(0.0045483, 0.991396, -0.13081, 0.00112335) +bones/55/rotation = Quaternion(0.0935469, 0.723518, -0.671481, 0.129938) +bones/56/rotation = Quaternion(-0.0280896, 0.999517, -0.001982, 0.0131158) +bones/57/rotation = Quaternion(-0.0606065, 0.0314289, 0.996173, -0.0545847) +bones/58/rotation = Quaternion(-0.00231955, 0.997177, -0.0750533, 0.000132893) +bones/59/rotation = Quaternion(-0.100123, 0.67561, -0.72831, -0.0556035) +bones/60/rotation = Quaternion(-0.00833549, 0.999661, 0.0240893, 0.00531644) [node name="Hoodie" type="MeshInstance3D" parent="Model/Female/Armature/GeneralSkeleton" index="2"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.000305099, -0.000408816) mesh = ExtResource("5_mkrgn") skin = ExtResource("4_b1tg1") [node name="BoneAttachment3D" type="BoneAttachment3D" parent="Model/Female/Armature/GeneralSkeleton" index="3"] -transform = Transform3D(1, 6.4651e-15, 4.77396e-15, -6.4651e-15, 1, -6.92683e-08, -4.77396e-15, 6.92683e-08, 1, 1.57651e-10, 1.37156, -0.0247111) +transform = Transform3D(0.989937, -0.128748, 0.0587304, 0.129651, 0.991489, -0.0118236, -0.0567083, 0.0193191, 0.998204, -0.0399633, 1.37256, 0.00421853) bone_name = "Head" bone_idx = 12 diff --git a/client/project.godot b/client/project.godot index 83d0f2f..1ab86a5 100644 --- a/client/project.godot +++ b/client/project.godot @@ -78,12 +78,6 @@ dash={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194325,"key_label":0,"unicode":0,"echo":false,"script":null) ] } -toggle_fullscreen={ -"deadzone": 0.5, -"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"echo":false,"script":null) -] -} attack={ "deadzone": 0.5, "events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) @@ -92,8 +86,7 @@ attack={ } aim={ "deadzone": 0.5, -"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null) +"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":9,"pressure":0.0,"pressed":false,"script":null) ] } menu={ @@ -102,16 +95,37 @@ menu={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":6,"pressure":0.0,"pressed":false,"script":null) ] } +look={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"canceled":false,"pressed":false,"double_click":false,"script":null) +] +} open_chat={ "deadzone": 0.5, "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null) ] } +toggle_fullscreen={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":true,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194342,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +zoom_in={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":4,"canceled":false,"pressed":false,"double_click":false,"script":null) +] +} +zoom_out={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":5,"canceled":false,"pressed":false,"double_click":false,"script":null) +] +} [physics] 3d/run_on_separate_thread=true -common/physics_ticks_per_second=100 +common/physics_ticks_per_second=180 [rendering] diff --git a/client/world/CameraPractical.tres b/client/world/CameraPractical.tres index 6e733e7..40dc39c 100644 --- a/client/world/CameraPractical.tres +++ b/client/world/CameraPractical.tres @@ -1,5 +1,6 @@ [gd_resource type="CameraAttributesPractical" format=3 uid="uid://b835orxyqq6w5"] [resource] -dof_blur_far_distance = 25.0 -dof_blur_far_transition = 25.0 +dof_blur_far_enabled = true +dof_blur_far_transition = 50.0 +dof_blur_near_enabled = true