feat: created aim and fire animations
parent
a7affe42ff
commit
be4fbb9d0b
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=12 format=3 uid="uid://c2kiuk2yxdlfr"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://c2kiuk2yxdlfr"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://1kr3qqan3trk" path="res://objects/player.tscn" id="1_7kr4i"]
|
||||
[ext_resource type="Environment" uid="uid://c1vy5rxxddw78" path="res://lighting/foggy_morning.tres" id="2_kx8fd"]
|
||||
|
@ -6,42 +6,20 @@
|
|||
[ext_resource type="PackedScene" uid="uid://c71yj2qpupn33" path="res://models/props/dirtpile_large.glb" id="4_vf68b"]
|
||||
[ext_resource type="PackedScene" uid="uid://brdhoy3efmba" path="res://models/props/trenchfloor.glb" id="5_styg7"]
|
||||
[ext_resource type="PackedScene" uid="uid://cesooq708ot6t" path="res://models/props/dirtpile_wall.glb" id="5_ww7ac"]
|
||||
[ext_resource type="Material" uid="uid://d0b6hpvc2dm8i" path="res://particles/floating_sparks.tres" id="8_i7y86"]
|
||||
[ext_resource type="Material" uid="uid://cjos8bwux43wt" path="res://particles/materials/sparks_material.tres" id="9_dsqky"]
|
||||
[ext_resource type="VoxelGIData" uid="uid://c3vqmnn5wr100" path="res://lighting/boot_voxelgi.tres" id="9_h7qgh"]
|
||||
[ext_resource type="ArrayOccluder3D" uid="uid://br22mqb65v0hg" path="res://occlusion/boot.occ" id="10_p3lbh"]
|
||||
|
||||
[sub_resource type="QuadMesh" id="QuadMesh_njmmu"]
|
||||
material = ExtResource("9_dsqky")
|
||||
size = Vector2(0.02, 0.02)
|
||||
|
||||
[node name="Boot" type="Node3D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_7kr4i")]
|
||||
physics_interpolation_mode = 1
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, 0)
|
||||
slide_on_ceiling = false
|
||||
|
||||
[node name="GPUParticles3D" type="GPUParticles3D" parent="Player"]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.333443, 2.06846, 6.55667)
|
||||
visibility_aabb = AABB(-2, -2, -2, 4, 4, 4)
|
||||
draw_order = 2
|
||||
process_material = ExtResource("8_i7y86")
|
||||
draw_pass_1 = SubResource("QuadMesh_njmmu")
|
||||
|
||||
[node name="GPUParticles3D2" type="GPUParticles3D" parent="Player"]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.333443, 2.06846, 1.4068)
|
||||
visibility_aabb = AABB(-2, -2, -2, 4, 4, 4)
|
||||
draw_order = 2
|
||||
process_material = ExtResource("8_i7y86")
|
||||
draw_pass_1 = SubResource("QuadMesh_njmmu")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = ExtResource("2_kx8fd")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="WorldEnvironment"]
|
||||
transform = Transform3D(-0.789875, -0.518225, 0.327934, -0.0262562, 0.562818, 0.826164, -0.612705, 0.643956, -0.458163, 0.295643, 3.22867, -2.4707)
|
||||
light_color = Color(1, 0.776887, 0.559189, 1)
|
||||
transform = Transform3D(-0.789875, -0.20633, 0.577517, -0.0262562, 0.952218, 0.304288, -0.612705, 0.225186, -0.757551, 0.295643, 3.22867, -2.4707)
|
||||
light_color = Color(0.95484, 0.837153, 0.722321, 1)
|
||||
light_energy = 0.708
|
||||
light_bake_mode = 1
|
||||
shadow_enabled = true
|
||||
|
@ -54,46 +32,46 @@ size = Vector3(11.5071, 3.49072, 23.3609)
|
|||
data = ExtResource("9_h7qgh")
|
||||
|
||||
[node name="trenchwall_2m" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367768, 0, -0.546675)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265775, 0, -0.546675)
|
||||
|
||||
[node name="trenchwall_2m2" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367768, 0, -2.55193)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265775, 0, -2.55193)
|
||||
|
||||
[node name="trenchwall_2m3" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367767, 0, -4.4575)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265774, 0, -4.4575)
|
||||
|
||||
[node name="trenchwall_2m4" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367767, 0, -6.36306)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265774, 0, -6.36306)
|
||||
|
||||
[node name="trenchwall_2m5" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367767, 0, -8.32269)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265774, 0, -8.32269)
|
||||
|
||||
[node name="trenchwall_2m6" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -0.546675)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -0.546675)
|
||||
|
||||
[node name="trenchwall_2m7" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -2.55193)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -2.55193)
|
||||
|
||||
[node name="trenchwall_2m8" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -4.4575)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -4.4575)
|
||||
|
||||
[node name="trenchwall_2m9" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -6.36306)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -6.36306)
|
||||
|
||||
[node name="trenchwall_2m10" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962452, 0, -8.32269)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769973, 0, -8.32269)
|
||||
|
||||
[node name="trenchwall_2m11" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367768, 0, -10.2944)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265775, 0, -10.2944)
|
||||
|
||||
[node name="trenchwall_2m12" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367768, 0, -12.2997)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265775, 0, -12.2997)
|
||||
|
||||
[node name="trenchwall_2m13" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367767, 0, -14.2053)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265774, 0, -14.2053)
|
||||
|
||||
[node name="trenchwall_2m14" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367767, 0, -16.1108)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265774, 0, -16.1108)
|
||||
|
||||
[node name="trenchwall_2m21" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1.31134e-07, 0, 1, 0, 1, 0, -1, 0, 1.31134e-07, 0.468356, 0, -21.3728)
|
||||
|
@ -111,7 +89,7 @@ transform = Transform3D(1.31134e-07, 0, 1, 0, 1, 0, -1, 0, 1.31134e-07, 4.46836,
|
|||
transform = Transform3D(1.31134e-07, 0, 1, 0, 1, 0, -1, 0, 1.31134e-07, -3.53164, 0, -21.3728)
|
||||
|
||||
[node name="trenchwall_2m15" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.367767, 0, -18.0705)
|
||||
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.265774, 0, -18.0705)
|
||||
|
||||
[node name="trenchwall_2m26" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -1.98323, -2.38419e-07, -19.702)
|
||||
|
@ -120,19 +98,19 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -1.983
|
|||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -3.98323, -2.38419e-07, -19.702)
|
||||
|
||||
[node name="trenchwall_2m16" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -10.2944)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -10.2944)
|
||||
|
||||
[node name="trenchwall_2m17" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -12.2997)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -12.2997)
|
||||
|
||||
[node name="trenchwall_2m18" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -14.2053)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -14.2053)
|
||||
|
||||
[node name="trenchwall_2m19" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962451, 0, -16.1108)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769972, 0, -16.1108)
|
||||
|
||||
[node name="trenchwall_2m20" parent="WorldEnvironment" instance=ExtResource("3_0aqqw")]
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.962452, 0, -18.0705)
|
||||
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, 0.769973, 0, -18.0705)
|
||||
|
||||
[node name="dirtpile_large" parent="WorldEnvironment" instance=ExtResource("4_vf68b")]
|
||||
transform = Transform3D(0.919924, 0, -0.392096, 0, 1, 0, 0.392096, 0, 0.919924, -0.102469, 0, -4.82641)
|
||||
|
@ -208,5 +186,6 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -1.855
|
|||
|
||||
[node name="OccluderInstance3D" type="OccluderInstance3D" parent="."]
|
||||
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0)
|
||||
visible = false
|
||||
occluder = ExtResource("10_p3lbh")
|
||||
bake_simplification_distance = 0.5
|
||||
|
|
Binary file not shown.
Binary file not shown.
BIN
godot/models/character.glb (Stored with Git LFS)
BIN
godot/models/character.glb (Stored with Git LFS)
Binary file not shown.
|
@ -8,6 +8,6 @@ resource_name = "Mud"
|
|||
specular_mode = 1
|
||||
albedo_texture = ExtResource("1_1d2ym")
|
||||
metallic = 0.497409
|
||||
roughness = 0.39
|
||||
roughness = 0.77
|
||||
normal_enabled = true
|
||||
normal_texture = ExtResource("2_4oxut")
|
||||
|
|
|
@ -1,72 +1,110 @@
|
|||
[gd_scene load_steps=17 format=3 uid="uid://1kr3qqan3trk"]
|
||||
[gd_scene load_steps=23 format=3 uid="uid://1kr3qqan3trk"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://vub54xgk5n0h" path="res://models/character.glb" id="1_mi4co"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ukhqm"]
|
||||
animation = &"Aim"
|
||||
play_mode = 1
|
||||
use_custom_timeline = true
|
||||
timeline_length = 0.6
|
||||
stretch_time_scale = false
|
||||
start_offset = 0.4
|
||||
loop_mode = 0
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nhlru"]
|
||||
animation = &"Aim"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8rbkq"]
|
||||
animation = &"Aim_Fire"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dqnnp"]
|
||||
animation = &"RESET"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7ceai"]
|
||||
animation = &"RESET"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0j2x4"]
|
||||
animation = &"Walk_forward"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_r3eap"]
|
||||
animation = &"Walk_forward"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vquhy"]
|
||||
animation = &"Walk_forward"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_47722"]
|
||||
animation = &"Walk_forward"
|
||||
|
||||
[sub_resource type="AnimationNodeBlendSpace2D" id="AnimationNodeBlendSpace2D_kg3k3"]
|
||||
blend_point_0/node = SubResource("AnimationNodeAnimation_0j2x4")
|
||||
blend_point_0/pos = Vector2(0, 1)
|
||||
blend_point_1/node = SubResource("AnimationNodeAnimation_r3eap")
|
||||
blend_point_1/pos = Vector2(-1, 0)
|
||||
blend_point_2/node = SubResource("AnimationNodeAnimation_vquhy")
|
||||
blend_point_2/pos = Vector2(1, 0)
|
||||
blend_point_3/node = SubResource("AnimationNodeAnimation_47722")
|
||||
blend_point_3/pos = Vector2(0, -1)
|
||||
|
||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_rb1jd"]
|
||||
filter_enabled = true
|
||||
filters = ["Character/Skeleton3D:Foot.L", "Character/Skeleton3D:Foot.R", "Character/Skeleton3D:IKTarget.Foot.L", "Character/Skeleton3D:IKTarget.Foot.R", "Character/Skeleton3D:hip", "Character/Skeleton3D:lowerleg.L", "Character/Skeleton3D:lowerleg.R", "Character/Skeleton3D:root", "Character/Skeleton3D:upperleg.L", "Character/Skeleton3D:upperleg.R"]
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_psu0r"]
|
||||
animation = &"Walk_forward"
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_2mbyh"]
|
||||
graph_offset = Vector2(-705, 40)
|
||||
graph_offset = Vector2(-703.5, -8.5)
|
||||
nodes/Base/node = SubResource("AnimationNodeAnimation_7ceai")
|
||||
nodes/Base/position = Vector2(-120, 120)
|
||||
nodes/Move/node = SubResource("AnimationNodeBlendSpace2D_kg3k3")
|
||||
nodes/Move/position = Vector2(-140, 280)
|
||||
nodes/Override/node = SubResource("AnimationNodeBlend2_rb1jd")
|
||||
nodes/Override/position = Vector2(100, 120)
|
||||
node_connections = [&"Override", 0, &"Base", &"Override", 1, &"Move", &"output", 0, &"Override"]
|
||||
nodes/Forward/node = SubResource("AnimationNodeBlend2_rb1jd")
|
||||
nodes/Forward/position = Vector2(100, 120)
|
||||
nodes/Walk/node = SubResource("AnimationNodeAnimation_psu0r")
|
||||
nodes/Walk/position = Vector2(-140, 300)
|
||||
node_connections = [&"Forward", 0, &"Base", &"Forward", 1, &"Walk", &"output", 0, &"Forward"]
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3mk5o"]
|
||||
xfade_time = 0.2
|
||||
advance_mode = 2
|
||||
advance_expression = "!input_directions.is_zero_approx()"
|
||||
advance_expression = "get_input_directions().y > 0.5"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mf4y3"]
|
||||
xfade_time = 0.2
|
||||
priority = 2
|
||||
advance_mode = 2
|
||||
advance_expression = "input_directions.is_zero_approx()"
|
||||
advance_expression = "get_input_directions().y <= 0.5"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_trxba"]
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_c81tj"]
|
||||
advance_mode = 2
|
||||
advance_expression = "get_input_directions().y < -0.5
|
||||
"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r26s5"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4lybd"]
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
advance_expression = "get_input_directions().y >= -0.5"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4im1q"]
|
||||
priority = 2
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5aafd"]
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
advance_expression = "get_input_direction() > 0.f"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8f4gl"]
|
||||
priority = 2
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xnat3"]
|
||||
reset = false
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_12bos"]
|
||||
advance_mode = 2
|
||||
advance_expression = "get_input_directions().y < -0.5"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7smdg"]
|
||||
states/Default/node = SubResource("AnimationNodeAnimation_dqnnp")
|
||||
states/Default/position = Vector2(338, 100)
|
||||
"states/Aim Down/node" = SubResource("AnimationNodeAnimation_ukhqm")
|
||||
"states/Aim Down/position" = Vector2(486, 196)
|
||||
"states/Aim Up/node" = SubResource("AnimationNodeAnimation_nhlru")
|
||||
"states/Aim Up/position" = Vector2(486, 98.5)
|
||||
states/Aim_Fire/node = SubResource("AnimationNodeAnimation_8rbkq")
|
||||
states/Aim_Fire/position = Vector2(647.5, 98)
|
||||
states/Idle/node = SubResource("AnimationNodeAnimation_dqnnp")
|
||||
states/Idle/position = Vector2(338, 100)
|
||||
states/Start/position = Vector2(204, 100)
|
||||
states/Walk/node = SubResource("AnimationNodeBlendTree_2mbyh")
|
||||
states/Walk/position = Vector2(338, 197.5)
|
||||
transitions = ["Default", "Walk", SubResource("AnimationNodeStateMachineTransition_3mk5o"), "Walk", "Default", SubResource("AnimationNodeStateMachineTransition_mf4y3"), "Start", "Default", SubResource("AnimationNodeStateMachineTransition_trxba")]
|
||||
graph_offset = Vector2(-307, -30.5)
|
||||
transitions = ["Idle", "Walk", SubResource("AnimationNodeStateMachineTransition_3mk5o"), "Walk", "Idle", SubResource("AnimationNodeStateMachineTransition_mf4y3"), "Idle", "Aim Up", SubResource("AnimationNodeStateMachineTransition_c81tj"), "Start", "Idle", SubResource("AnimationNodeStateMachineTransition_r26s5"), "Aim Up", "Aim Down", SubResource("AnimationNodeStateMachineTransition_4lybd"), "Aim Down", "Idle", SubResource("AnimationNodeStateMachineTransition_4im1q"), "Aim Down", "Walk", SubResource("AnimationNodeStateMachineTransition_5aafd"), "Aim Up", "Aim_Fire", SubResource("AnimationNodeStateMachineTransition_8f4gl"), "Aim_Fire", "Aim Up", SubResource("AnimationNodeStateMachineTransition_xnat3"), "Walk", "Aim Up", SubResource("AnimationNodeStateMachineTransition_12bos")]
|
||||
graph_offset = Vector2(-290.049, -113.5)
|
||||
|
||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_hiswf"]
|
||||
graph_offset = Vector2(-510.4, 51.9)
|
||||
nodes/Actions/node = SubResource("AnimationNodeStateMachine_7smdg")
|
||||
nodes/Actions/position = Vector2(20, 140)
|
||||
node_connections = [&"output", 0, &"Actions"]
|
||||
|
@ -75,6 +113,7 @@ node_connections = [&"output", 0, &"Actions"]
|
|||
radius = 0.370388
|
||||
|
||||
[node name="Player" type="Player"]
|
||||
slide_on_ceiling = false
|
||||
floor_constant_speed = true
|
||||
|
||||
[node name="PlayerInput" type="PlayerInput" parent="."]
|
||||
|
@ -88,8 +127,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0337329, 0)
|
|||
bones/0/rotation = Quaternion(1.12928e-22, 1, 2.98023e-08, -1.94707e-07)
|
||||
bones/1/position = Vector3(3.28472e-17, 0.826102, -2.26306e-09)
|
||||
bones/1/rotation = Quaternion(-0.0189873, -6.3066e-09, -1.08731e-09, 0.99982)
|
||||
bones/2/rotation = Quaternion(0.0262842, 8.66579e-09, 1.56723e-09, 0.999655)
|
||||
bones/3/rotation = Quaternion(-0.013812, -0.124595, 8.42949e-05, 0.992112)
|
||||
bones/4/rotation = Quaternion(0.0100466, 3.28411e-09, 6.2804e-10, 0.99995)
|
||||
bones/4/rotation = Quaternion(0.0100466, -3.89644e-10, 6.78268e-10, 0.99995)
|
||||
bones/5/rotation = Quaternion(-0.0233085, 0.0669743, -0.00156502, 0.997481)
|
||||
bones/6/rotation = Quaternion(0.623077, 0.672557, 0.307599, -0.254607)
|
||||
bones/7/rotation = Quaternion(-0.311931, -0.528262, 0.360764, 0.702487)
|
||||
|
@ -97,9 +137,9 @@ bones/8/rotation = Quaternion(0.385362, 0.19105, 0.552643, 0.71385)
|
|||
bones/9/rotation = Quaternion(0.204715, 0.0914037, 0.275611, 0.93476)
|
||||
bones/10/rotation = Quaternion(-0.160687, -0.0459478, -0.0475321, 0.984789)
|
||||
bones/10/scale = Vector3(1, 1, 1)
|
||||
bones/11/rotation = Quaternion(-0.030518, -0.0130498, -0.0216153, 0.999215)
|
||||
bones/11/rotation = Quaternion(-0.0305181, -0.0130498, -0.0216154, 0.999215)
|
||||
bones/11/scale = Vector3(1, 1, 1)
|
||||
bones/12/rotation = Quaternion(0.00872479, 0.00565773, 0.00131029, 0.999945)
|
||||
bones/12/rotation = Quaternion(0.00872478, 0.00565776, 0.00131029, 0.999945)
|
||||
bones/12/scale = Vector3(1, 1, 1)
|
||||
bones/13/rotation = Quaternion(-0.617934, -0.0462445, 0.180663, 0.763793)
|
||||
bones/13/scale = Vector3(1, 1, 1)
|
||||
|
@ -117,6 +157,7 @@ bones/21/rotation = Quaternion(-0.193467, 0.101022, 0.0447897, 0.974864)
|
|||
bones/21/scale = Vector3(1, 1, 1)
|
||||
bones/22/rotation = Quaternion(-0.293695, -0.10649, 0.259809, 0.91373)
|
||||
bones/22/scale = Vector3(1, 1, 1)
|
||||
bones/23/rotation = Quaternion(-0.0310475, -0.0162324, -0.00151601, 0.999385)
|
||||
bones/24/rotation = Quaternion(0.140362, -0.0289769, -0.195164, 0.970242)
|
||||
bones/25/rotation = Quaternion(0.585184, -0.476496, -0.473244, -0.454479)
|
||||
bones/25/scale = Vector3(1, 1, 1)
|
||||
|
@ -147,29 +188,31 @@ bones/42/rotation = Quaternion(-0.0310476, 0.0162325, 0.00151597, 0.999385)
|
|||
bones/43/rotation = Quaternion(-0.00109126, -0.0104143, 0.0283538, 0.999543)
|
||||
bones/44/position = Vector3(0.16719, 0.195796, -0.0454406)
|
||||
bones/44/rotation = Quaternion(-0.610992, 0.0971646, 0.14821, 0.771545)
|
||||
bones/45/rotation = Quaternion(-0.82326, 3.22824e-09, -1.0876e-07, 0.567665)
|
||||
bones/46/rotation = Quaternion(-0.00112372, -6.19338e-08, -7.24686e-11, 0.999999)
|
||||
bones/47/rotation = Quaternion(0.706312, -2.22455e-08, 6.70979e-08, 0.707901)
|
||||
bones/47/scale = Vector3(1, 1, 1)
|
||||
bones/48/rotation = Quaternion(-0.112129, 0.585203, -0.155744, 0.78785)
|
||||
bones/45/rotation = Quaternion(-0.82326, 4.1804e-09, -1.03579e-07, 0.567665)
|
||||
bones/46/position = Vector3(8.07956e-09, 0.0363644, 0.0392254)
|
||||
bones/46/rotation = Quaternion(-0.00112372, -6.23921e-08, 6.44731e-09, 0.999999)
|
||||
bones/48/rotation = Quaternion(0.706312, -2.22455e-08, 6.70979e-08, 0.707901)
|
||||
bones/48/scale = Vector3(1, 1, 1)
|
||||
bones/49/rotation = Quaternion(0.31578, 0.920316, 0.115311, -0.200014)
|
||||
bones/49/position = Vector3(0.0228929, -0.0282939, -0.00824324)
|
||||
bones/49/rotation = Quaternion(-0.112129, 0.585203, -0.155744, 0.78785)
|
||||
bones/49/scale = Vector3(1, 1, 1)
|
||||
bones/50/rotation = Quaternion(0.997309, -0.00549226, 0.0715033, -0.015225)
|
||||
bones/50/rotation = Quaternion(0.31578, 0.920316, 0.115311, -0.200014)
|
||||
bones/50/scale = Vector3(1, 1, 1)
|
||||
bones/51/rotation = Quaternion(-0.00225666, 0.00306653, -0.000453776, 0.999993)
|
||||
bones/51/rotation = Quaternion(0.997309, -0.00549226, 0.0715033, -0.015225)
|
||||
bones/51/scale = Vector3(1, 1, 1)
|
||||
bones/52/rotation = Quaternion(0.665461, 0.000165138, -0.00238783, 0.746429)
|
||||
bones/53/rotation = Quaternion(0.997309, 0.00549227, -0.0715033, -0.015225)
|
||||
bones/53/scale = Vector3(1, 1, 1)
|
||||
bones/54/rotation = Quaternion(-0.00225666, -0.0030665, 0.000453778, 0.999993)
|
||||
bones/52/rotation = Quaternion(-0.00225666, 0.00306653, -0.000453776, 0.999993)
|
||||
bones/52/scale = Vector3(1, 1, 1)
|
||||
bones/53/rotation = Quaternion(0.665461, 0.000165138, -0.00238783, 0.746429)
|
||||
bones/54/rotation = Quaternion(0.997309, 0.00549227, -0.0715033, -0.015225)
|
||||
bones/54/scale = Vector3(1, 1, 1)
|
||||
bones/55/rotation = Quaternion(0.665461, -0.000165001, 0.00238774, 0.746429)
|
||||
bones/55/rotation = Quaternion(-0.00225666, -0.0030665, 0.000453778, 0.999993)
|
||||
bones/55/scale = Vector3(1, 1, 1)
|
||||
bones/56/rotation = Quaternion(-0.707107, 8.33981e-07, 8.33981e-07, 0.707107)
|
||||
bones/57/rotation = Quaternion(-0.707107, -8.33981e-07, -8.33981e-07, 0.707107)
|
||||
bones/58/rotation = Quaternion(-0.707107, 1.25097e-07, 1.25097e-07, 0.707107)
|
||||
bones/56/rotation = Quaternion(0.665461, -0.000165001, 0.00238774, 0.746429)
|
||||
bones/56/scale = Vector3(1, 1, 1)
|
||||
bones/57/rotation = Quaternion(-0.707107, 8.33981e-07, 8.33981e-07, 0.707107)
|
||||
bones/58/rotation = Quaternion(-0.707107, -8.33981e-07, -8.33981e-07, 0.707107)
|
||||
bones/59/rotation = Quaternion(-0.707107, 1.25097e-07, 1.25097e-07, 0.707107)
|
||||
bones/60/rotation = Quaternion(-0.707107, 1.25097e-07, 1.25097e-07, 0.707107)
|
||||
|
||||
[node name="AnimationTree" type="AnimationTree" parent="CharacterModel"]
|
||||
unique_name_in_owner = true
|
||||
|
@ -178,11 +221,11 @@ root_motion_track = NodePath("Character/Skeleton3D:root")
|
|||
tree_root = SubResource("AnimationNodeBlendTree_hiswf")
|
||||
advance_expression_base_node = NodePath("../..")
|
||||
anim_player = NodePath("../AnimationPlayer")
|
||||
parameters/Actions/Walk/Move/blend_position = Vector2(0.000621557, -0.00896859)
|
||||
parameters/Actions/Walk/Override/blend_amount = 1.0
|
||||
parameters/Actions/Walk/Forward/blend_amount = 1.0
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(-1, -6.25964e-09, -8.71984e-08, -5.22128e-09, 0.999929, -0.0119029, 8.72667e-08, -0.0119029, -0.999929, -0.409573, 1.61765, -0.822631)
|
||||
[node name="Camera" type="Camera3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(-1, -6.25962e-09, -8.71984e-08, -1.4325e-08, 0.995684, 0.0928047, 8.62412e-08, 0.0928047, -0.995684, -0.383042, 1.71014, -0.773267)
|
||||
fov = 57.0005
|
||||
far = 100.0
|
||||
|
||||
|
|
BIN
models/character.blend (Stored with Git LFS)
BIN
models/character.blend (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
models/modules.blend (Stored with Git LFS)
BIN
models/modules.blend (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
|
@ -5,33 +5,37 @@
|
|||
|
||||
void Player::_bind_methods() {
|
||||
#define CLASSNAME Player
|
||||
GDPROPERTY(input_directions, gd::Variant::VECTOR2);
|
||||
GDFUNCTION(get_input_directions);
|
||||
}
|
||||
|
||||
void Player::_ready() {
|
||||
if(gd::Engine::get_singleton()->is_editor_hint())
|
||||
return;
|
||||
this->anim_tree = this->get_node<gd::AnimationTree>("%AnimationTree");
|
||||
this->sfm = gd::Object::cast_to<gd::AnimationNodeStateMachinePlayback>(this->anim_tree->get("parameters/Actions/playback"));
|
||||
this->input = this->get_node<utils::PlayerInput>("%PlayerInput");
|
||||
this->input->listen_to(utils::PlayerInput::Listener("dir_left", "dir_right", callable_mp(this, &Player::_on_dir_horizontal)));
|
||||
this->input->listen_to(utils::PlayerInput::Listener("dir_backward", "dir_forward", callable_mp(this, &Player::_on_dir_vertical)));
|
||||
this->input->listen_to(utils::PlayerInput::Listener("look_left", "look_right", callable_mp(this, &Player::_on_look_horizontal)));
|
||||
this->input->listen_to(utils::PlayerInput::Listener("look_down", "look_up", callable_mp(this, &Player::_on_look_vertical)));
|
||||
this->input->listen_to(utils::PlayerInput::Listener("_mouse_left", "_mouse_right", callable_mp(this, &Player::_on_look_horizontal)));
|
||||
this->input->listen_to(utils::PlayerInput::Listener("_mouse_down", "_mouse_up", callable_mp(this, &Player::_on_look_vertical)));
|
||||
this->model_node = this->get_node<gd::Node3D>("%CharacterModel");
|
||||
}
|
||||
|
||||
void Player::_process(double delta [[maybe_unused]]) {
|
||||
this->anim_tree->set("parameters/Actions/Walk/Move/blend_position", this->input_directions);
|
||||
void Player::_process(double delta) {
|
||||
if(gd::Engine::get_singleton()->is_editor_hint())
|
||||
return;
|
||||
this->anim_tree->set("parameters/Actions/Walk/Forward/blend_amount", gd::Math::clamp(this->input_directions.y, 0.5f, 1.f));
|
||||
this->rotate_y(-this->input_directions.x * delta);
|
||||
}
|
||||
|
||||
void Player::_physics_process(double delta [[maybe_unused]]) {
|
||||
if(gd::Engine::get_singleton()->is_editor_hint())
|
||||
return;
|
||||
gd::Basis const &model_basis{this->model_node->get_global_basis()};
|
||||
gd::Vector3 const local_motion{this->anim_tree->get_root_motion_position()};
|
||||
gd::Vector3 const motion {
|
||||
local_motion.x * model_basis.get_column(0) +
|
||||
local_motion.y * model_basis.get_column(1) +
|
||||
local_motion.z * model_basis.get_column(2)
|
||||
local_motion.z * model_basis.get_column(2) +
|
||||
(this->is_on_floor() ? gd::Vector3{} : gd::Vector3{0.f, -1.f, 0.f})
|
||||
};
|
||||
this->set_velocity(motion / delta);
|
||||
this->move_and_slide();
|
||||
|
@ -45,16 +49,6 @@ void Player::_on_dir_vertical(gd::Ref<gd::InputEvent>, float value) {
|
|||
this->input_directions.y = value;
|
||||
}
|
||||
|
||||
void Player::_on_look_horizontal(gd::Ref<gd::InputEvent>, float value) {
|
||||
this->input_look.x = value;
|
||||
}
|
||||
|
||||
void Player::_on_look_vertical(gd::Ref<gd::InputEvent>, float value) {
|
||||
this->input_look.y = value;
|
||||
}
|
||||
|
||||
void Player::set_input_directions(gd::Vector2 value [[maybe_unused]]) {}
|
||||
|
||||
gd::Vector2 Player::get_input_directions() const {
|
||||
return this->input_directions;
|
||||
}
|
||||
|
|
|
@ -17,10 +17,7 @@ public:
|
|||
|
||||
void _on_dir_horizontal(gd::Ref<gd::InputEvent>, float value);
|
||||
void _on_dir_vertical(gd::Ref<gd::InputEvent>, float value);
|
||||
void _on_look_horizontal(gd::Ref<gd::InputEvent>, float value);
|
||||
void _on_look_vertical(gd::Ref<gd::InputEvent>, float value);
|
||||
|
||||
void set_input_directions(gd::Vector2 value);
|
||||
gd::Vector2 get_input_directions() const;
|
||||
private:
|
||||
gd::AnimationTree *anim_tree{nullptr};
|
||||
|
@ -28,7 +25,6 @@ private:
|
|||
utils::PlayerInput *input{nullptr};
|
||||
gd::Node3D *model_node{nullptr};
|
||||
gd::Vector2 input_directions{};
|
||||
gd::Vector2 input_look{};
|
||||
};
|
||||
|
||||
#endif // !TR_PLAYER_HPP
|
||||
|
|
|
@ -15,7 +15,7 @@ void initialize_gdextension_types(ModuleInitializationLevel p_level)
|
|||
return;
|
||||
}
|
||||
utils::godot_cpp_utils_register_types();
|
||||
GDREGISTER_RUNTIME_CLASS(Player);
|
||||
GDREGISTER_CLASS(Player);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
|
|
Loading…
Reference in New Issue