feat: updated rifle texture, turning animation
This commit is contained in:
parent
92f31aa85b
commit
efc8006c66
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
godot/models/animations/Aim.res
Normal file
BIN
godot/models/animations/Aim.res
Normal file
Binary file not shown.
BIN
godot/models/animations/Aim_Fire.res
Normal file
BIN
godot/models/animations/Aim_Fire.res
Normal file
Binary file not shown.
Binary file not shown.
BIN
godot/models/animations/Turn_left.res
Normal file
BIN
godot/models/animations/Turn_left.res
Normal file
Binary file not shown.
BIN
godot/models/animations/Turn_right.res
Normal file
BIN
godot/models/animations/Turn_right.res
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:dac3325bf581718e44b20aa4cd96fca882350e730218ac70da6efe669b5abb77
|
oid sha256:02bb57a7618cdb5a9710f81dda9d106fa65b42388ddfc54c4737d8892d80e811
|
||||||
size 974656
|
size 1557812
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -2,15 +2,12 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://03bidmgkyu7x"
|
uid="uid://bpbh6yad5us1u"
|
||||||
path.s3tc="res://.godot/imported/character_grid.png-2d0e906f71f3e26d2c036075a68637c9.s3tc.ctex"
|
path.s3tc="res://.godot/imported/character_grid.png-2d0e906f71f3e26d2c036075a68637c9.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
generator_parameters={
|
|
||||||
"md5": "5251a685620ecec968e08d819a2a66a5"
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:da6fd2aa2650150467a3ec08d9bd37d7545057fce020e453354ddd3f3d643675
|
|
||||||
size 30156
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:da6fd2aa2650150467a3ec08d9bd37d7545057fce020e453354ddd3f3d643675
|
|
||||||
size 30156
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="CompressedTexture2D"
|
|
||||||
uid="uid://bfbggseqfivqg"
|
|
||||||
path.s3tc="res://.godot/imported/character_lee_enfield.jpg-6d1650ff6ac73c0058d6c5c97b6347e0.s3tc.ctex"
|
|
||||||
metadata={
|
|
||||||
"imported_formats": ["s3tc_bptc"],
|
|
||||||
"vram_texture": true
|
|
||||||
}
|
|
||||||
generator_parameters={
|
|
||||||
"md5": "2f63e7aacd33f2b1b77cb71dd6821df5"
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://models/character_lee_enfield.jpg"
|
|
||||||
dest_files=["res://.godot/imported/character_lee_enfield.jpg-6d1650ff6ac73c0058d6c5c97b6347e0.s3tc.ctex"]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=2
|
|
||||||
compress/high_quality=false
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_compression=1
|
|
||||||
compress/normal_map=0
|
|
||||||
compress/channel_pack=0
|
|
||||||
mipmaps/generate=true
|
|
||||||
mipmaps/limit=-1
|
|
||||||
roughness/mode=0
|
|
||||||
roughness/src_normal=""
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
process/hdr_as_srgb=false
|
|
||||||
process/hdr_clamp_exposure=false
|
|
||||||
process/size_limit=0
|
|
||||||
detect_3d/compress_to=0
|
|
||||||
3
godot/models/character_rifle.png
Normal file
3
godot/models/character_rifle.png
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a28ab4d7a0be49abfb5de55ed47c05dfa2778649794b37755e8afd71407e5ef8
|
||||||
|
size 381127
|
||||||
|
|
@ -2,20 +2,17 @@
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://bwq5navx6qi1l"
|
uid="uid://b2y2j72db80od"
|
||||||
path.s3tc="res://.godot/imported/character_lee-enfield.jpg-8aa5d8a65848beefe70a765079e8bd2c.s3tc.ctex"
|
path.s3tc="res://.godot/imported/character_rifle.png-59d3a7b80c91b62335b799778e2ab8de.s3tc.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"imported_formats": ["s3tc_bptc"],
|
||||||
"vram_texture": true
|
"vram_texture": true
|
||||||
}
|
}
|
||||||
generator_parameters={
|
|
||||||
"md5": "2f63e7aacd33f2b1b77cb71dd6821df5"
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://models/character_lee-enfield.jpg"
|
source_file="res://models/character_rifle.png"
|
||||||
dest_files=["res://.godot/imported/character_lee-enfield.jpg-8aa5d8a65848beefe70a765079e8bd2c.s3tc.ctex"]
|
dest_files=["res://.godot/imported/character_rifle.png-59d3a7b80c91b62335b799778e2ab8de.s3tc.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dibu06h02xpdh"]
|
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dibu06h02xpdh"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://bfbggseqfivqg" path="res://models/character_lee_enfield.jpg" id="1_8jtmf"]
|
[ext_resource type="Texture2D" uid="uid://b2y2j72db80od" path="res://models/character_rifle.png" id="1_iex1v"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
resource_name = "Material"
|
resource_name = "Material"
|
||||||
cull_mode = 2
|
cull_mode = 2
|
||||||
specular_mode = 1
|
specular_mode = 1
|
||||||
albedo_texture = ExtResource("1_8jtmf")
|
albedo_texture = ExtResource("1_iex1v")
|
||||||
metallic = 0.293814
|
metallic = 0.293814
|
||||||
roughness = 0.64433
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://c2ic02ndhqkod"]
|
[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://c2ic02ndhqkod"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://03bidmgkyu7x" path="res://models/character_grid.png" id="1_54a4n"]
|
[ext_resource type="Texture2D" uid="uid://bpbh6yad5us1u" path="res://models/character_grid.png" id="1_54a4n"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
resource_name = "Primary"
|
resource_name = "Primary"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=23 format=3 uid="uid://1kr3qqan3trk"]
|
[gd_scene load_steps=28 format=3 uid="uid://1kr3qqan3trk"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://vub54xgk5n0h" path="res://models/character.glb" id="1_mi4co"]
|
[ext_resource type="PackedScene" uid="uid://vub54xgk5n0h" path="res://models/character.glb" id="1_mi4co"]
|
||||||
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
animation = &"Aim"
|
animation = &"Aim"
|
||||||
play_mode = 1
|
play_mode = 1
|
||||||
use_custom_timeline = true
|
use_custom_timeline = true
|
||||||
timeline_length = 0.6
|
timeline_length = 0.4
|
||||||
stretch_time_scale = false
|
stretch_time_scale = false
|
||||||
start_offset = 0.4
|
start_offset = 0.0
|
||||||
loop_mode = 0
|
loop_mode = 0
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nhlru"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nhlru"]
|
||||||
|
|
@ -53,8 +53,7 @@ advance_expression = "get_input_directions().y <= 0.5"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_c81tj"]
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_c81tj"]
|
||||||
advance_mode = 2
|
advance_mode = 2
|
||||||
advance_expression = "get_input_directions().y < -0.5
|
advance_expression = "get_input_directions().y < -0.9"
|
||||||
"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r26s5"]
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r26s5"]
|
||||||
advance_mode = 2
|
advance_mode = 2
|
||||||
|
|
@ -62,7 +61,7 @@ advance_mode = 2
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4lybd"]
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4lybd"]
|
||||||
switch_mode = 2
|
switch_mode = 2
|
||||||
advance_mode = 2
|
advance_mode = 2
|
||||||
advance_expression = "get_input_directions().y >= -0.5"
|
advance_expression = "get_input_directions().y >= -0.9"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4im1q"]
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4im1q"]
|
||||||
priority = 2
|
priority = 2
|
||||||
|
|
@ -78,6 +77,7 @@ advance_expression = "get_input_direction() > 0.f"
|
||||||
priority = 2
|
priority = 2
|
||||||
switch_mode = 2
|
switch_mode = 2
|
||||||
advance_mode = 2
|
advance_mode = 2
|
||||||
|
advance_expression = "get_input_fire()"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xnat3"]
|
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xnat3"]
|
||||||
reset = false
|
reset = false
|
||||||
|
|
@ -89,25 +89,51 @@ advance_mode = 2
|
||||||
advance_expression = "get_input_directions().y < -0.5"
|
advance_expression = "get_input_directions().y < -0.5"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7smdg"]
|
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7smdg"]
|
||||||
"states/Aim Down/node" = SubResource("AnimationNodeAnimation_ukhqm")
|
"states/Aim Down [aim]/node" = SubResource("AnimationNodeAnimation_ukhqm")
|
||||||
"states/Aim Down/position" = Vector2(486, 196)
|
"states/Aim Down [aim]/position" = Vector2(537, 197.5)
|
||||||
"states/Aim Up/node" = SubResource("AnimationNodeAnimation_nhlru")
|
"states/Aim [aim] [turn]/node" = SubResource("AnimationNodeAnimation_nhlru")
|
||||||
"states/Aim Up/position" = Vector2(486, 98.5)
|
"states/Aim [aim] [turn]/position" = Vector2(537, 98)
|
||||||
states/Aim_Fire/node = SubResource("AnimationNodeAnimation_8rbkq")
|
states/End/position = Vector2(204, 197.5)
|
||||||
states/Aim_Fire/position = Vector2(647.5, 98)
|
"states/Fire [aim]/node" = SubResource("AnimationNodeAnimation_8rbkq")
|
||||||
states/Idle/node = SubResource("AnimationNodeAnimation_dqnnp")
|
"states/Fire [aim]/position" = Vector2(752.5, 98)
|
||||||
states/Idle/position = Vector2(338, 100)
|
"states/Idle [turn_animated]/node" = SubResource("AnimationNodeAnimation_dqnnp")
|
||||||
|
"states/Idle [turn_animated]/position" = Vector2(338, 100)
|
||||||
states/Start/position = Vector2(204, 100)
|
states/Start/position = Vector2(204, 100)
|
||||||
states/Walk/node = SubResource("AnimationNodeBlendTree_2mbyh")
|
"states/Walk [turn]/node" = SubResource("AnimationNodeBlendTree_2mbyh")
|
||||||
states/Walk/position = Vector2(338, 197.5)
|
"states/Walk [turn]/position" = Vector2(338, 197.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")]
|
transitions = ["Idle [turn_animated]", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_3mk5o"), "Walk [turn]", "Idle [turn_animated]", SubResource("AnimationNodeStateMachineTransition_mf4y3"), "Idle [turn_animated]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_c81tj"), "Start", "Idle [turn_animated]", SubResource("AnimationNodeStateMachineTransition_r26s5"), "Aim [aim] [turn]", "Aim Down [aim]", SubResource("AnimationNodeStateMachineTransition_4lybd"), "Aim Down [aim]", "Idle [turn_animated]", SubResource("AnimationNodeStateMachineTransition_4im1q"), "Aim Down [aim]", "Walk [turn]", SubResource("AnimationNodeStateMachineTransition_5aafd"), "Aim [aim] [turn]", "Fire [aim]", SubResource("AnimationNodeStateMachineTransition_8f4gl"), "Fire [aim]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_xnat3"), "Walk [turn]", "Aim [aim] [turn]", SubResource("AnimationNodeStateMachineTransition_12bos")]
|
||||||
graph_offset = Vector2(-290.049, -113.5)
|
graph_offset = Vector2(-351.759, -7)
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_cwpxw"]
|
||||||
|
filter_enabled = true
|
||||||
|
filters = ["Character/Skeleton3D:Foot.L", "Character/Skeleton3D:Foot.R", "Character/Skeleton3D:IKTarget.Foot.L", "Character/Skeleton3D:IKTarget.Foot.R", "Character/Skeleton3D:PoleTarget.Foot.L", "Character/Skeleton3D:PoleTarget.Foot.R", "Character/Skeleton3D:hip", "Character/Skeleton3D:lowerleg.L", "Character/Skeleton3D:lowerleg.R", "Character/Skeleton3D:spine.001", "Character/Skeleton3D:upperleg.L", "Character/Skeleton3D:upperleg.R"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ltmcj"]
|
||||||
|
animation = &"Turn_left"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_1g6a2"]
|
||||||
|
animation = &"Turn_right"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dgkx8"]
|
||||||
|
animation = &"RESET"
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeBlendSpace1D" id="AnimationNodeBlendSpace1D_ajqf0"]
|
||||||
|
blend_point_0/node = SubResource("AnimationNodeAnimation_ltmcj")
|
||||||
|
blend_point_0/pos = 1.0
|
||||||
|
blend_point_1/node = SubResource("AnimationNodeAnimation_1g6a2")
|
||||||
|
blend_point_1/pos = -1.0
|
||||||
|
blend_point_2/node = SubResource("AnimationNodeAnimation_dgkx8")
|
||||||
|
blend_point_2/pos = 0.0
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_hiswf"]
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_hiswf"]
|
||||||
graph_offset = Vector2(-510.4, 51.9)
|
graph_offset = Vector2(-203, -3.5)
|
||||||
nodes/Actions/node = SubResource("AnimationNodeStateMachine_7smdg")
|
nodes/Actions/node = SubResource("AnimationNodeStateMachine_7smdg")
|
||||||
nodes/Actions/position = Vector2(20, 140)
|
nodes/Actions/position = Vector2(-80, 140)
|
||||||
node_connections = [&"output", 0, &"Actions"]
|
nodes/TurnAnimation/node = SubResource("AnimationNodeBlend2_cwpxw")
|
||||||
|
nodes/TurnAnimation/position = Vector2(120, 140)
|
||||||
|
nodes/TurnDirection/node = SubResource("AnimationNodeBlendSpace1D_ajqf0")
|
||||||
|
nodes/TurnDirection/position = Vector2(-80, 300)
|
||||||
|
node_connections = [&"TurnAnimation", 0, &"Actions", &"TurnAnimation", 1, &"TurnDirection", &"output", 0, &"TurnAnimation"]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ewsvd"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ewsvd"]
|
||||||
radius = 0.370388
|
radius = 0.370388
|
||||||
|
|
@ -126,7 +152,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0337329, 0)
|
||||||
[node name="Skeleton3D" parent="CharacterModel/Character" index="0"]
|
[node name="Skeleton3D" parent="CharacterModel/Character" index="0"]
|
||||||
bones/0/rotation = Quaternion(1.12928e-22, 1, 2.98023e-08, -1.94707e-07)
|
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/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/1/rotation = Quaternion(-0.0189874, -6.30661e-09, -1.08732e-09, 0.99982)
|
||||||
bones/2/rotation = Quaternion(0.0262842, 8.66579e-09, 1.56723e-09, 0.999655)
|
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/3/rotation = Quaternion(-0.013812, -0.124595, 8.42949e-05, 0.992112)
|
||||||
bones/4/rotation = Quaternion(0.0100466, -3.89644e-10, 6.78268e-10, 0.99995)
|
bones/4/rotation = Quaternion(0.0100466, -3.89644e-10, 6.78268e-10, 0.99995)
|
||||||
|
|
@ -203,16 +229,18 @@ bones/51/scale = Vector3(1, 1, 1)
|
||||||
bones/52/rotation = Quaternion(-0.00225666, 0.00306653, -0.000453776, 0.999993)
|
bones/52/rotation = Quaternion(-0.00225666, 0.00306653, -0.000453776, 0.999993)
|
||||||
bones/52/scale = Vector3(1, 1, 1)
|
bones/52/scale = Vector3(1, 1, 1)
|
||||||
bones/53/rotation = Quaternion(0.665461, 0.000165138, -0.00238783, 0.746429)
|
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/rotation = Quaternion(0.997309, 0.00549226, -0.0715033, -0.015225)
|
||||||
bones/54/scale = Vector3(1, 1, 1)
|
bones/54/scale = Vector3(1, 1, 1)
|
||||||
bones/55/rotation = Quaternion(-0.00225666, -0.0030665, 0.000453778, 0.999993)
|
bones/55/rotation = Quaternion(-0.00225666, -0.0030665, 0.000453778, 0.999993)
|
||||||
bones/55/scale = Vector3(1, 1, 1)
|
bones/55/scale = Vector3(1, 1, 1)
|
||||||
bones/56/rotation = Quaternion(0.665461, -0.000165001, 0.00238774, 0.746429)
|
bones/56/rotation = Quaternion(0.665461, -0.000165001, 0.00238774, 0.746429)
|
||||||
bones/56/scale = Vector3(1, 1, 1)
|
bones/56/scale = Vector3(1, 1, 1)
|
||||||
bones/57/rotation = Quaternion(-0.707107, 8.33981e-07, 8.33981e-07, 0.707107)
|
bones/57/rotation = Quaternion(-2.99921e-13, 0.707107, 0.707107, -2.99921e-13)
|
||||||
bones/58/rotation = Quaternion(-0.707107, -8.33981e-07, -8.33981e-07, 0.707107)
|
bones/58/rotation = Quaternion(2.01446e-13, 0.707107, 0.707107, 2.01446e-13)
|
||||||
bones/59/rotation = Quaternion(-0.707107, 1.25097e-07, 1.25097e-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)
|
bones/60/rotation = Quaternion(-0.707107, 1.25097e-07, 1.25097e-07, 0.707107)
|
||||||
|
bones/61/rotation = Quaternion(-0.707107, 1.5189e-07, 1.5189e-07, 0.707107)
|
||||||
|
bones/62/rotation = Quaternion(-0.707107, 1.5189e-07, 1.5189e-07, 0.707107)
|
||||||
|
|
||||||
[node name="AnimationTree" type="AnimationTree" parent="CharacterModel"]
|
[node name="AnimationTree" type="AnimationTree" parent="CharacterModel"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
@ -221,16 +249,21 @@ root_motion_track = NodePath("Character/Skeleton3D:root")
|
||||||
tree_root = SubResource("AnimationNodeBlendTree_hiswf")
|
tree_root = SubResource("AnimationNodeBlendTree_hiswf")
|
||||||
advance_expression_base_node = NodePath("../..")
|
advance_expression_base_node = NodePath("../..")
|
||||||
anim_player = NodePath("../AnimationPlayer")
|
anim_player = NodePath("../AnimationPlayer")
|
||||||
parameters/Actions/Walk/Forward/blend_amount = 1.0
|
"parameters/Actions/Walk [turn]/Forward/blend_amount" = 1.0
|
||||||
|
parameters/TurnAnimation/blend_amount = 0
|
||||||
[node name="Camera" type="Camera3D" parent="."]
|
parameters/TurnDirection/blend_position = -1.0
|
||||||
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
|
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||||
shape = SubResource("CapsuleShape3D_ewsvd")
|
shape = SubResource("CapsuleShape3D_ewsvd")
|
||||||
|
|
||||||
|
[node name="CameraParent" type="Node3D" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
top_level = true
|
||||||
|
|
||||||
|
[node name="Camera" type="Camera3D" parent="CameraParent"]
|
||||||
|
transform = Transform3D(-0.99874, 0.00857726, -0.0494361, -1.83936e-08, 0.98528, 0.170948, 0.0501747, 0.170733, -0.984039, -0.510957, 1.68471, -1.00759)
|
||||||
|
fov = 42.5804
|
||||||
|
far = 100.0
|
||||||
|
|
||||||
[editable path="CharacterModel"]
|
[editable path="CharacterModel"]
|
||||||
|
|
|
||||||
|
|
@ -41,13 +41,13 @@ dir_backward={
|
||||||
dir_left={
|
dir_left={
|
||||||
"deadzone": 0.2,
|
"deadzone": 0.2,
|
||||||
"events": [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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
"events": [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":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":-1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":-1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
dir_right={
|
dir_right={
|
||||||
"deadzone": 0.2,
|
"deadzone": 0.2,
|
||||||
"events": [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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
"events": [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":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":0,"axis_value":1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":2,"axis_value":1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
look_left={
|
look_left={
|
||||||
|
|
@ -70,6 +70,12 @@ look_down={
|
||||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
|
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
fire={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [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":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":3,"pressure":0.0,"pressed":true,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
[physics]
|
[physics]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:5ee6afa4a1a910d294d7de19ab4e26b4050d947297ada70b1f238439443855d5
|
oid sha256:3cbe2b511344382a9e2fdd63f3b066b54e181bfdf7c38543263bcfa227b12055
|
||||||
size 2332244
|
size 2501008
|
||||||
|
|
|
||||||
Binary file not shown.
3
models/textures/rifle.kra
Normal file
3
models/textures/rifle.kra
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b0e11236244f62d387e703ee30887d3ba9076fd9b6b80f76d6a18086e1116a36
|
||||||
|
size 2256428
|
||||||
BIN
models/textures/rifle.kra~
Normal file
BIN
models/textures/rifle.kra~
Normal file
Binary file not shown.
3
models/textures/rifle.png
Normal file
3
models/textures/rifle.png
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:a28ab4d7a0be49abfb5de55ed47c05dfa2778649794b37755e8afd71407e5ef8
|
||||||
|
size 381127
|
||||||
BIN
models/textures/rifle.png~
Normal file
BIN
models/textures/rifle.png~
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 806 KiB |
|
|
@ -6,24 +6,30 @@
|
||||||
void Player::_bind_methods() {
|
void Player::_bind_methods() {
|
||||||
#define CLASSNAME Player
|
#define CLASSNAME Player
|
||||||
GDFUNCTION(get_input_directions);
|
GDFUNCTION(get_input_directions);
|
||||||
|
GDFUNCTION(get_input_fire);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::_ready() {
|
void Player::_ready() {
|
||||||
if(gd::Engine::get_singleton()->is_editor_hint())
|
if(gd::Engine::get_singleton()->is_editor_hint())
|
||||||
return;
|
return;
|
||||||
this->anim_tree = this->get_node<gd::AnimationTree>("%AnimationTree");
|
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->fsm = gd::Object::cast_to<gd::AnimationNodeStateMachinePlayback>(this->anim_tree->get("parameters/Actions/playback"));
|
||||||
this->input = this->get_node<utils::PlayerInput>("%PlayerInput");
|
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_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("dir_backward", "dir_forward", callable_mp(this, &Player::_on_dir_vertical)));
|
||||||
|
this->input->listen_to(utils::PlayerInput::Listener("fire", callable_mp(this, &Player::_on_fire)));
|
||||||
this->model_node = this->get_node<gd::Node3D>("%CharacterModel");
|
this->model_node = this->get_node<gd::Node3D>("%CharacterModel");
|
||||||
|
this->camera_parent = this->get_node<gd::Node3D>("%CameraParent");
|
||||||
|
this->camera_parent->set_global_rotation(this->get_global_rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::_process(double delta) {
|
void Player::_process(double delta) {
|
||||||
if(gd::Engine::get_singleton()->is_editor_hint())
|
if(gd::Engine::get_singleton()->is_editor_hint())
|
||||||
return;
|
return;
|
||||||
this->anim_tree->set("parameters/Actions/Walk/Forward/blend_amount", gd::Math::clamp(this->input_directions.y, 0.5f, 1.f));
|
if(this->input_fire >= 0.0)
|
||||||
this->rotate_y(-this->input_directions.x * delta);
|
this->input_fire -= delta;
|
||||||
|
this->process_rotate(delta);
|
||||||
|
this->process_transform_camera(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::_physics_process(double delta [[maybe_unused]]) {
|
void Player::_physics_process(double delta [[maybe_unused]]) {
|
||||||
|
|
@ -41,6 +47,29 @@ void Player::_physics_process(double delta [[maybe_unused]]) {
|
||||||
this->move_and_slide();
|
this->move_and_slide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::process_transform_camera(double delta) {
|
||||||
|
this->camera_parent->set_global_position(this->get_global_position());
|
||||||
|
float const camera_speed{float(delta) * (this->fsm->get_current_node().contains("[aim]") ? this->AIMING_CAMERA_ROTATION_SPEED : this->CAMERA_ROTATION_SPEED)};
|
||||||
|
this->camera_parent->rotate_y(this->input_directions.x * -camera_speed);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Player::process_rotate(double delta) {
|
||||||
|
if(this->fsm->get_current_node().contains("[turn]") || this->fsm->get_current_node().contains("[turn_animated]")) {
|
||||||
|
//! the signed angle difference between the left axes of the camera parent and Player
|
||||||
|
float const diff = -this->camera_parent->get_global_basis().get_column(0).signed_angle_to(this->get_global_basis().get_column(0), {0.f, 1.f, 0.f});
|
||||||
|
//! the maximum rotation to allow for this frame
|
||||||
|
float const speed{float(delta) * this->ROTATION_SPEED};
|
||||||
|
float const actual_speed{speed < gd::Math::abs(diff) ? gd::Math::sign(diff) * speed : diff};
|
||||||
|
// rotate by max allowed or full difference, whichever has the smaller magnitude
|
||||||
|
this->rotate_y(actual_speed);
|
||||||
|
this->anim_tree->set("parameters/TurnDirection/blend_position", diff / (this->ROTATION_SPEED * .5f));
|
||||||
|
this->anim_tree->set("parameters/TurnAnimation/blend_amount", this->fsm->get_current_node().contains("[turn_animated]") ? 1.f : 0.f);
|
||||||
|
} else {
|
||||||
|
this->anim_tree->set("parameters/TurnAnimation/blend_amount", 0.f);
|
||||||
|
this->anim_tree->set("parameters/TurnDirection/blend_position", 0.f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::_on_dir_horizontal(gd::Ref<gd::InputEvent>, float value) {
|
void Player::_on_dir_horizontal(gd::Ref<gd::InputEvent>, float value) {
|
||||||
this->input_directions.x = value;
|
this->input_directions.x = value;
|
||||||
}
|
}
|
||||||
|
|
@ -49,6 +78,18 @@ void Player::_on_dir_vertical(gd::Ref<gd::InputEvent>, float value) {
|
||||||
this->input_directions.y = value;
|
this->input_directions.y = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::_on_fire(gd::Ref<gd::InputEvent>, float value) {
|
||||||
|
if(value > 0.f) {
|
||||||
|
this->input_fire = 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gd::Vector2 Player::get_input_directions() const {
|
gd::Vector2 Player::get_input_directions() const {
|
||||||
return this->input_directions;
|
return this->input_directions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Player::get_input_fire() {
|
||||||
|
bool const val = this->input_fire > 0.0;
|
||||||
|
this->input_fire = 0.0;
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,16 +15,27 @@ public:
|
||||||
virtual void _process(double delta) override;
|
virtual void _process(double delta) override;
|
||||||
virtual void _physics_process(double delta) override;
|
virtual void _physics_process(double delta) override;
|
||||||
|
|
||||||
|
void process_transform_camera(double delta);
|
||||||
|
void process_rotate(double delta);
|
||||||
|
|
||||||
void _on_dir_horizontal(gd::Ref<gd::InputEvent>, float value);
|
void _on_dir_horizontal(gd::Ref<gd::InputEvent>, float value);
|
||||||
void _on_dir_vertical(gd::Ref<gd::InputEvent>, float value);
|
void _on_dir_vertical(gd::Ref<gd::InputEvent>, float value);
|
||||||
|
void _on_fire(gd::Ref<gd::InputEvent>, float value);
|
||||||
|
|
||||||
gd::Vector2 get_input_directions() const;
|
gd::Vector2 get_input_directions() const;
|
||||||
|
bool get_input_fire();
|
||||||
private:
|
private:
|
||||||
gd::AnimationTree *anim_tree{nullptr};
|
gd::AnimationTree *anim_tree{nullptr};
|
||||||
gd::AnimationNodeStateMachinePlayback *sfm{nullptr};
|
gd::AnimationNodeStateMachinePlayback *fsm{nullptr};
|
||||||
|
gd::Node3D *camera_parent{nullptr};
|
||||||
utils::PlayerInput *input{nullptr};
|
utils::PlayerInput *input{nullptr};
|
||||||
gd::Node3D *model_node{nullptr};
|
gd::Node3D *model_node{nullptr};
|
||||||
gd::Vector2 input_directions{};
|
gd::Vector2 input_directions{0.f, 0.f};
|
||||||
|
double input_fire{0.0};
|
||||||
|
|
||||||
|
float const ROTATION_SPEED{1.5f};
|
||||||
|
float const CAMERA_ROTATION_SPEED{2.f};
|
||||||
|
float const AIMING_CAMERA_ROTATION_SPEED{1.f};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !TR_PLAYER_HPP
|
#endif // !TR_PLAYER_HPP
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue