tweak: rotate animation;feat: rifle_normal map
parent
efc8006c66
commit
e522dfb364
Binary file not shown.
Binary file not shown.
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.
Binary file not shown.
|
@ -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
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
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/textures/rifle.kra (Stored with Git LFS)
BIN
models/textures/rifle.kra (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue