diff --git a/godot/models/animations/Aim.res b/godot/models/animations/Aim.res index 333e1a7..c487779 100644 Binary files a/godot/models/animations/Aim.res and b/godot/models/animations/Aim.res differ diff --git a/godot/models/animations/Aim_Fire.res b/godot/models/animations/Aim_Fire.res index 3cd6071..1766b91 100644 Binary files a/godot/models/animations/Aim_Fire.res and b/godot/models/animations/Aim_Fire.res differ diff --git a/godot/models/animations/RESET.res b/godot/models/animations/RESET.res index 02e9534..cbd89f9 100644 Binary files a/godot/models/animations/RESET.res and b/godot/models/animations/RESET.res differ diff --git a/godot/models/animations/Walk_forward.res b/godot/models/animations/Walk_forward.res index 843c826..c6a24e4 100644 Binary files a/godot/models/animations/Walk_forward.res and b/godot/models/animations/Walk_forward.res differ diff --git a/godot/models/character.glb b/godot/models/character.glb index c6c4eee..250ec0b 100644 --- a/godot/models/character.glb +++ b/godot/models/character.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:02bb57a7618cdb5a9710f81dda9d106fa65b42388ddfc54c4737d8892d80e811 -size 1557812 +oid sha256:ec386cdcbc2e0ec58510e26639006824660bdefc627b9985bbd99e7121abd01e +size 1894204 diff --git a/godot/models/character_rifle_normal.png b/godot/models/character_rifle_normal.png new file mode 100644 index 0000000..0210188 --- /dev/null +++ b/godot/models/character_rifle_normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3141b1abdce15138066b1863006fae0fa7ff888fc2c504a8b19e341b9f3dc645 +size 335515 diff --git a/godot/models/character_rifle_normal.png.import b/godot/models/character_rifle_normal.png.import new file mode 100644 index 0000000..7d55369 --- /dev/null +++ b/godot/models/character_rifle_normal.png.import @@ -0,0 +1,38 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://uml6arceudcw" +path.s3tc="res://.godot/imported/character_rifle_normal.png-e117ec8ee646c93ddc752f3341090218.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "125780422df01dc9771b3f117027b5bb" +} + +[deps] + +source_file="res://models/character_rifle_normal.png" +dest_files=["res://.godot/imported/character_rifle_normal.png-e117ec8ee646c93ddc752f3341090218.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://models/character_rifle_normal.png" +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 diff --git a/godot/models/materials/Material.tres b/godot/models/materials/Material.tres index d3fc5be..40700b9 100644 --- a/godot/models/materials/Material.tres +++ b/godot/models/materials/Material.tres @@ -1,6 +1,7 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dibu06h02xpdh"] +[gd_resource type="StandardMaterial3D" load_steps=3 format=3 uid="uid://dibu06h02xpdh"] [ext_resource type="Texture2D" uid="uid://b2y2j72db80od" path="res://models/character_rifle.png" id="1_iex1v"] +[ext_resource type="Texture2D" uid="uid://uml6arceudcw" path="res://models/character_rifle_normal.png" id="2_061h0"] [resource] resource_name = "Material" @@ -8,3 +9,6 @@ cull_mode = 2 specular_mode = 1 albedo_texture = ExtResource("1_iex1v") metallic = 0.293814 +normal_enabled = true +normal_scale = 0.25 +normal_texture = ExtResource("2_061h0") diff --git a/godot/objects/player.tscn b/godot/objects/player.tscn index 442078c..0bce5c2 100644 --- a/godot/objects/player.tscn +++ b/godot/objects/player.tscn @@ -46,7 +46,7 @@ advance_mode = 2 advance_expression = "get_input_directions().y > 0.5" [sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mf4y3"] -xfade_time = 0.2 +xfade_time = 0.6 priority = 2 advance_mode = 2 advance_expression = "get_input_directions().y <= 0.5" @@ -90,23 +90,23 @@ advance_expression = "get_input_directions().y < -0.5" [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7smdg"] "states/Aim Down [aim]/node" = SubResource("AnimationNodeAnimation_ukhqm") -"states/Aim Down [aim]/position" = Vector2(537, 197.5) +"states/Aim Down [aim]/position" = Vector2(583.446, 263.781) "states/Aim [aim] [turn]/node" = SubResource("AnimationNodeAnimation_nhlru") -"states/Aim [aim] [turn]/position" = Vector2(537, 98) +"states/Aim [aim] [turn]/position" = Vector2(583.364, 97.9174) states/End/position = Vector2(204, 197.5) "states/Fire [aim]/node" = SubResource("AnimationNodeAnimation_8rbkq") -"states/Fire [aim]/position" = Vector2(752.5, 98) +"states/Fire [aim]/position" = Vector2(798.864, 97.9174) "states/Idle [turn_animated]/node" = SubResource("AnimationNodeAnimation_dqnnp") -"states/Idle [turn_animated]/position" = Vector2(338, 100) +"states/Idle [turn_animated]/position" = Vector2(384.364, 99.9174) states/Start/position = Vector2(204, 100) "states/Walk [turn]/node" = SubResource("AnimationNodeBlendTree_2mbyh") -"states/Walk [turn]/position" = Vector2(338, 197.5) +"states/Walk [turn]/position" = Vector2(384.446, 263.781) 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(-351.759, -7) +graph_offset = Vector2(-151.601, -33.5439) [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"] +filters = ["Character/Skeleton3D:Foot.L", "Character/Skeleton3D:Foot.R", "Character/Skeleton3D:IKTarget.Foot.L", "Character/Skeleton3D:IKTarget.Foot.R", "Character/Skeleton3D:Neck", "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:spine.002", "Character/Skeleton3D:spine.003", "Character/Skeleton3D:upperleg.L", "Character/Skeleton3D:upperleg.R"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ltmcj"] animation = &"Turn_left" @@ -126,7 +126,7 @@ blend_point_2/node = SubResource("AnimationNodeAnimation_dgkx8") blend_point_2/pos = 0.0 [sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_hiswf"] -graph_offset = Vector2(-203, -3.5) +graph_offset = Vector2(-380, 0) nodes/Actions/node = SubResource("AnimationNodeStateMachine_7smdg") nodes/Actions/position = Vector2(-80, 140) nodes/TurnAnimation/node = SubResource("AnimationNodeBlend2_cwpxw") @@ -262,7 +262,7 @@ 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) +transform = Transform3D(-0.99874, 0.00680423, -0.0497112, -1.86265e-08, 0.990762, 0.135611, 0.0501747, 0.13544, -0.989514, -0.510957, 1.68471, -1.00759) fov = 42.5804 far = 100.0 diff --git a/godot/project.godot b/godot/project.godot index 032218a..9b602bf 100644 --- a/godot/project.godot +++ b/godot/project.godot @@ -20,7 +20,7 @@ config/icon="res://icon.svg" window/size/viewport_width=1920 window/size/viewport_height=1080 -window/size/mode=4 +window/size/mode=3 window/stretch/mode="viewport" window/stretch/aspect="keep_width" diff --git a/models/character.blend b/models/character.blend index 6ee1d9e..1bc7d15 100644 --- a/models/character.blend +++ b/models/character.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3cbe2b511344382a9e2fdd63f3b066b54e181bfdf7c38543263bcfa227b12055 -size 2501008 +oid sha256:3142bfa44ccacb5cf3ef92199da6ae0cd4ffbb140f15ed121803e3bcfdcd1412 +size 2516476 diff --git a/models/character.blend1 b/models/character.blend1 index 0bea923..19d9662 100644 Binary files a/models/character.blend1 and b/models/character.blend1 differ diff --git a/models/textures/rifle.kra b/models/textures/rifle.kra index 4eb3683..c1f2636 100644 --- a/models/textures/rifle.kra +++ b/models/textures/rifle.kra @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b0e11236244f62d387e703ee30887d3ba9076fd9b6b80f76d6a18086e1116a36 -size 2256428 +oid sha256:de194a0de12e3a8f32ca279748712647ac27f59abe03ff83af2b9773c2199666 +size 2865292 diff --git a/models/textures/rifle.kra~ b/models/textures/rifle.kra~ index acc6a81..3804e2b 100644 Binary files a/models/textures/rifle.kra~ and b/models/textures/rifle.kra~ differ diff --git a/models/textures/rifle_height.png b/models/textures/rifle_height.png new file mode 100644 index 0000000..14dac94 --- /dev/null +++ b/models/textures/rifle_height.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6666969c801eec4b9c70459a60b3e6c2dd9745708fb2b9ccafb5a261fcfd9c85 +size 219178 diff --git a/models/textures/rifle_normal.png b/models/textures/rifle_normal.png new file mode 100644 index 0000000..0210188 --- /dev/null +++ b/models/textures/rifle_normal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3141b1abdce15138066b1863006fae0fa7ff888fc2c504a8b19e341b9f3dc645 +size 335515 diff --git a/src/player.cpp b/src/player.cpp index 8d6ee02..6aa387e 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -54,7 +54,7 @@ void Player::process_transform_camera(double delta) { } void Player::process_rotate(double delta) { - if(this->fsm->get_current_node().contains("[turn]") || this->fsm->get_current_node().contains("[turn_animated]")) { + if(this->fsm->get_current_node().contains("[turn")) { //! 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 @@ -62,7 +62,7 @@ void Player::process_rotate(double delta) { 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/TurnDirection/blend_position", diff * M_PI_2f); 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);