summaryrefslogtreecommitdiff
path: root/godot/scenes/characters
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2022-09-25 06:39:12 -0400
committerAnson Bridges <bridges.anson@gmail.com>2022-09-25 06:39:12 -0400
commit7a1d857de96174dfa5a0fa40f8c14acbd2f651c2 (patch)
treed52acaa4e89b0f8375326ea1aefd0105bb91cfc7 /godot/scenes/characters
parent62039380a67b6da396d1c8d745d2e2625ba988fc (diff)
weapons, viewmodels, some performance fixes
Diffstat (limited to 'godot/scenes/characters')
-rw-r--r--godot/scenes/characters/PlayerRigid.tscn67
-rw-r--r--godot/scenes/characters/viewmodel_arms.tscn180
2 files changed, 208 insertions, 39 deletions
diff --git a/godot/scenes/characters/PlayerRigid.tscn b/godot/scenes/characters/PlayerRigid.tscn
index 5a5a63a..6e9fe48 100644
--- a/godot/scenes/characters/PlayerRigid.tscn
+++ b/godot/scenes/characters/PlayerRigid.tscn
@@ -1,19 +1,20 @@
-[gd_scene load_steps=11 format=2]
+[gd_scene load_steps=13 format=2]
[ext_resource path="res://scripts/characters/player_controller_new.gd" type="Script" id=1]
[ext_resource path="res://theming/FreeMono.otf" type="DynamicFontData" id=2]
[ext_resource path="res://scenes/characters/PlayerAreaDetect.gd" type="Script" id=3]
+[ext_resource path="res://scenes/characters/viewmodel_arms.tscn" type="PackedScene" id=4]
+[ext_resource path="res://scenes/weapons/hands.res" type="Resource" id=5]
+[ext_resource path="res://scenes/weapons/pistol.tres" type="Resource" id=6]
+[ext_resource path="res://scenes/weapons/rockets.tres" type="Resource" id=7]
-[sub_resource type="PhysicsMaterial" id=3]
+[sub_resource type="PhysicsMaterial" id=8]
resource_local_to_scene = true
rough = true
[sub_resource type="BoxShape" id=6]
extents = Vector3( 0.325, 0.9, 0.325 )
-[sub_resource type="CubeMesh" id=2]
-size = Vector3( 0.2, 0.2, 1 )
-
[sub_resource type="CubeMesh" id=4]
size = Vector3( 0.6, 1.8, 0.6 )
@@ -26,29 +27,32 @@ font_data = ExtResource( 2 )
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.325, 0.9, 0.325 )
-[sub_resource type="CylinderMesh" id=7]
-top_radius = 0.01
-bottom_radius = 0.01
-height = 0.3
-radial_segments = 6
-
[node name="Soldier" type="RigidBody" groups=["playable", "player"]]
collision_layer = 32769
collision_mask = 32769
mode = 2
mass = 80.0
-physics_material_override = SubResource( 3 )
+physics_material_override = SubResource( 8 )
continuous_cd = true
contacts_reported = 3
contact_monitor = true
+can_sleep = false
+axis_lock_angular_x = true
+axis_lock_angular_y = true
+axis_lock_angular_z = true
linear_damp = 0.0
angular_damp = 0.0
script = ExtResource( 1 )
+weapon_slot1 = ExtResource( 5 )
+weapon_slot2 = ExtResource( 6 )
+weapon_slot3 = ExtResource( 7 )
[node name="Collision" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0 )
shape = SubResource( 6 )
+[node name="WeaponSound" type="AudioStreamPlayer3D" parent="."]
+
[node name="Neck" type="Spatial" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.44, 0 )
@@ -66,30 +70,16 @@ unique_name_in_owner = true
enabled = true
cast_to = Vector3( 0, 0, -2.5 )
collision_mask = 262145
-collide_with_areas = true
-[node name="viewmodel_c" type="ViewportContainer" parent="Neck"]
-visible = false
-margin_right = 1024.0
-margin_bottom = 600.0
-
-[node name="viewmodel" type="Viewport" parent="Neck/viewmodel_c"]
-size = Vector2( 1024, 600 )
-transparent_bg = true
-handle_input_locally = false
-render_target_update_mode = 0
-
-[node name="vm_camera" type="Camera" parent="Neck/viewmodel_c/viewmodel"]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.539779, 0 )
-cull_mask = 524288
-current = true
-fov = 90.0
-far = 75.9
-
-[node name="MeshInstance" type="MeshInstance" parent="Neck/viewmodel_c/viewmodel"]
-transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0266792, -0.813922 )
-layers = 524288
-mesh = SubResource( 2 )
+[node name="GunRay" type="RayCast" parent="Neck/Head"]
+cast_to = Vector3( 0, 0, -300 )
+
+[node name="VIEWMODEL_ARMS" parent="Neck/Head" instance=ExtResource( 4 )]
+unique_name_in_owner = true
+transform = Transform( -0.1, 0, -1.50996e-08, 0, 0.1, 0, 1.50996e-08, 0, -0.1, 0, -0.055375, 0.0132675 )
+
+[node name="CarryPoint" type="Position3D" parent="Neck/Head"]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.07564 )
[node name="Feet" type="RayCast" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.03, 0 )
@@ -113,14 +103,13 @@ font = SubResource( 5 )
[node name="AreaDetect" type="Area" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0 )
+collision_layer = 4
+collision_mask = 4
+monitorable = false
script = ExtResource( 3 )
[node name="Collision" type="CollisionShape" parent="AreaDetect"]
shape = SubResource( 1 )
-[node name="normal_vis" type="MeshInstance" parent="."]
-mesh = SubResource( 7 )
-skeleton = NodePath("../Feet")
-
[connection signal="area_entered" from="AreaDetect" to="AreaDetect" method="_on_AreaDetect_area_entered"]
[connection signal="area_exited" from="AreaDetect" to="AreaDetect" method="_on_AreaDetect_area_exited"]
diff --git a/godot/scenes/characters/viewmodel_arms.tscn b/godot/scenes/characters/viewmodel_arms.tscn
new file mode 100644
index 0000000..1808785
--- /dev/null
+++ b/godot/scenes/characters/viewmodel_arms.tscn
@@ -0,0 +1,180 @@
+[gd_scene load_steps=13 format=2]
+
+[ext_resource path="res://animations/humanidle.tres" type="Animation" id=1]
+[ext_resource path="res://animations/humanpunch.tres" type="Animation" id=2]
+[ext_resource path="res://meshes/human/viewmodel_arms.tres" type="ArrayMesh" id=3]
+[ext_resource path="res://meshes/human/viewmodel_arms_SKIN.tres" type="Skin" id=4]
+[ext_resource path="res://animations/raise_fists.tres" type="Animation" id=5]
+[ext_resource path="res://animations/lower_fists.tres" type="Animation" id=6]
+[ext_resource path="res://animations/fists_idle.tres" type="Animation" id=7]
+[ext_resource path="res://animations/pistol_idle_vm.tres" type="Animation" id=8]
+[ext_resource path="res://animations/pistol_fire_vm.tres" type="Animation" id=9]
+[ext_resource path="res://animations/pistol_reload_vm.tres" type="Animation" id=10]
+[ext_resource path="res://animations/rockets_launch_vm.tres" type="Animation" id=11]
+[ext_resource path="res://animations/rockets_idle_vm.tres" type="Animation" id=12]
+
+[node name="viewmodel_arms" type="Spatial"]
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+autoplay = "humanidle"
+anims/fists_idle = ExtResource( 7 )
+anims/humanidle = ExtResource( 1 )
+anims/humanpunch = ExtResource( 2 )
+anims/lower_fists = ExtResource( 6 )
+anims/pistol_fire_vm = ExtResource( 9 )
+anims/pistol_idle_vm = ExtResource( 8 )
+anims/pistol_reload_vm = ExtResource( 10 )
+anims/raise_fists = ExtResource( 5 )
+anims/rockets_idle_vm = ExtResource( 12 )
+anims/rockets_launch_vm = ExtResource( 11 )
+
+[node name="Skeleton" type="Skeleton" parent="."]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.507587, -0.379486 )
+bones/0/name = "ArmRoot.R"
+bones/0/parent = -1
+bones/0/rest = Transform( -0.177871, -0.984054, 3.39781e-08, 0.984054, -0.177871, -1.94956e-07, 1.97891e-07, -1.24085e-09, 1, 0, 0.591936, 0.369128 )
+bones/0/enabled = true
+bones/0/bound_children = [ ]
+bones/1/name = "Shoulder.R"
+bones/1/parent = 0
+bones/1/rest = Transform( 0.787947, -0.615656, -0.0103313, 0.61496, 0.78768, -0.0371922, 0.0310354, 0.0229522, 0.999255, 3.97029e-08, 0.622106, 6.46544e-09 )
+bones/1/enabled = true
+bones/1/bound_children = [ ]
+bones/2/name = "Elbow.R"
+bones/2/parent = 1
+bones/2/rest = Transform( 0.977179, 0.125413, 0.171442, 0.0174242, 0.757057, -0.653116, -0.2117, 0.641199, 0.737595, -1.78814e-07, 1.67641, 4.05125e-08 )
+bones/2/enabled = true
+bones/2/bound_children = [ ]
+bones/3/name = "Wrist.R"
+bones/3/parent = 2
+bones/3/rest = Transform( 0.942879, -0.20747, 0.260645, 0.237384, 0.967355, -0.0887301, -0.233727, 0.145535, 0.961348, 2.68221e-07, 1.29325, 0 )
+bones/3/enabled = true
+bones/3/bound_children = [ NodePath("GunBone") ]
+bones/4/name = "Thumb.R"
+bones/4/parent = 3
+bones/4/rest = Transform( 0.771494, -0.608265, -0.186579, 0.518122, 0.770842, -0.370612, 0.369253, 0.189254, 0.909854, -0.138479, 0.349082, 0.150327 )
+bones/4/enabled = true
+bones/4/bound_children = [ ]
+bones/5/name = "ThumbJoint.R"
+bones/5/parent = 4
+bones/5/rest = Transform( 0.998414, 0.0553932, 0.0100235, -0.0557424, 0.997692, 0.0387759, -0.00785248, -0.0392731, 0.999198, 1.19209e-07, 0.185314, 1.49012e-07 )
+bones/5/enabled = true
+bones/5/bound_children = [ ]
+bones/6/name = "Forefinger.R"
+bones/6/parent = 3
+bones/6/rest = Transform( 0.990211, -0.0868984, 0.109229, 0.087316, 0.99618, 0.000963221, -0.108895, 0.00858365, 0.994016, -0.0704187, 0.577644, 0.101705 )
+bones/6/enabled = true
+bones/6/bound_children = [ ]
+bones/7/name = "ForefingerJoint.R"
+bones/7/parent = 6
+bones/7/rest = Transform( 0.961771, -0.273567, -0.0125167, 0.273567, 0.957673, 0.0895728, -0.0125173, -0.0895727, 0.995902, -1.78814e-07, 0.168752, -7.45058e-08 )
+bones/7/enabled = true
+bones/7/bound_children = [ ]
+bones/8/name = "Middlefinger.R"
+bones/8/parent = 3
+bones/8/rest = Transform( 0.99595, -0.0877201, -0.0197039, 0.0899057, 0.972106, 0.216627, 0.000151744, -0.217521, 0.976056, -0.00396565, 0.635147, -0.0137653 )
+bones/8/enabled = true
+bones/8/bound_children = [ ]
+bones/9/name = "MiddlefingerJoint.R"
+bones/9/parent = 8
+bones/9/rest = Transform( 0.952338, -0.302326, -0.0406409, 0.302788, 0.953041, 0.00561015, 0.0370363, -0.0176483, 0.999158, 4.61936e-07, 0.171389, 8.9407e-08 )
+bones/9/enabled = true
+bones/9/bound_children = [ ]
+bones/10/name = "Ringfinger.R"
+bones/10/parent = 3
+bones/10/rest = Transform( 0.996881, -0.0294961, 0.073197, 0.00553321, 0.951366, 0.308013, -0.0787223, -0.306647, 0.948562, 0.047418, 0.585948, -0.124826 )
+bones/10/enabled = true
+bones/10/bound_children = [ ]
+bones/11/name = "RingfingerJoint.R"
+bones/11/parent = 10
+bones/11/rest = Transform( 0.993602, -0.107312, 0.035221, 0.107189, 0.994224, 0.00535263, -0.035592, -0.00154307, 0.999365, 1.19209e-07, 0.148602, -6.89179e-08 )
+bones/11/enabled = true
+bones/11/bound_children = [ ]
+bones/12/name = "Pinky.R"
+bones/12/parent = 3
+bones/12/rest = Transform( 0.956205, -0.152718, 0.249696, -0.0177502, 0.821265, 0.570271, -0.292157, -0.549728, 0.782587, 0.0680349, 0.524245, -0.176284 )
+bones/12/enabled = true
+bones/12/bound_children = [ ]
+bones/13/name = "HandIK.R"
+bones/13/parent = -1
+bones/13/rest = Transform( 0.569709, -0.756887, -0.32024, 0.81482, 0.469348, 0.340267, -0.10724, -0.454791, 0.884118, -2.46612, -1.39053, 1.26266 )
+bones/13/enabled = true
+bones/13/bound_children = [ ]
+bones/14/name = "HandIK.L"
+bones/14/parent = -1
+bones/14/rest = Transform( 0.569709, 0.756887, 0.32024, -0.81482, 0.469348, 0.340267, 0.10724, -0.454791, 0.884118, 2.46964, -1.39423, 1.2634 )
+bones/14/enabled = true
+bones/14/bound_children = [ ]
+bones/15/name = "ArmRoot.L"
+bones/15/parent = -1
+bones/15/rest = Transform( 0.0316384, 0.984054, 0.175035, 0.175035, -0.177871, 0.968362, 0.984054, -8.9407e-08, -0.177871, 0, 0.591936, 0.369128 )
+bones/15/enabled = true
+bones/15/bound_children = [ ]
+bones/16/name = "Shoulder.L"
+bones/16/parent = 15
+bones/16/rest = Transform( -0.170694, -0.0869216, 0.981483, -0.61496, 0.787681, -0.0371923, -0.769862, -0.609921, -0.187906, -1.49012e-08, 0.622106, -7.45058e-09 )
+bones/16/enabled = true
+bones/16/bound_children = [ ]
+bones/17/name = "Elbow.L"
+bones/17/parent = 16
+bones/17/rest = Transform( 0.977179, -0.125413, -0.171442, -0.0174242, 0.757057, -0.653116, 0.2117, 0.641199, 0.737596, -3.91155e-08, 1.67642, -3.72529e-09 )
+bones/17/enabled = true
+bones/17/bound_children = [ ]
+bones/18/name = "Wrist.L"
+bones/18/parent = 17
+bones/18/rest = Transform( 0.942879, 0.20747, -0.260645, -0.237384, 0.967355, -0.0887299, 0.233727, 0.145534, 0.961349, -1.49012e-08, 1.29325, -1.78814e-07 )
+bones/18/enabled = true
+bones/18/bound_children = [ ]
+bones/19/name = "Thumb.L"
+bones/19/parent = 18
+bones/19/rest = Transform( 0.771494, 0.608265, 0.186579, -0.518122, 0.770842, -0.370612, -0.369253, 0.189254, 0.909854, 0.138479, 0.349082, 0.150327 )
+bones/19/enabled = true
+bones/19/bound_children = [ ]
+bones/20/name = "ThumbJoint.L"
+bones/20/parent = 19
+bones/20/rest = Transform( 0.998414, -0.0553931, -0.0100235, 0.0557423, 0.997692, 0.038776, 0.00785247, -0.0392732, 0.999198, -5.96046e-08, 0.185314, 3.27826e-07 )
+bones/20/enabled = true
+bones/20/bound_children = [ ]
+bones/21/name = "Forefinger.L"
+bones/21/parent = 18
+bones/21/rest = Transform( 0.990211, 0.0868986, -0.109229, -0.0873162, 0.99618, 0.000963001, 0.108895, 0.00858388, 0.994016, 0.0704185, 0.577644, 0.101706 )
+bones/21/enabled = true
+bones/21/bound_children = [ ]
+bones/22/name = "ForefingerJoint.L"
+bones/22/parent = 21
+bones/22/rest = Transform( 0.961771, 0.273567, 0.0125167, -0.273567, 0.957673, 0.0895729, 0.0125173, -0.0895728, 0.995902, -2.98023e-08, 0.168752, 2.5332e-07 )
+bones/22/enabled = true
+bones/22/bound_children = [ ]
+bones/23/name = "Middlefinger.L"
+bones/23/parent = 18
+bones/23/rest = Transform( 0.99595, 0.0877202, 0.0197039, -0.0899058, 0.972106, 0.216626, -0.000151757, -0.217521, 0.976056, 0.00396539, 0.635146, -0.0137648 )
+bones/23/enabled = true
+bones/23/bound_children = [ ]
+bones/24/name = "MiddlefingerJoint.L"
+bones/24/parent = 23
+bones/24/rest = Transform( 0.952338, 0.302326, 0.0406409, -0.302788, 0.953041, 0.0056103, -0.0370364, -0.0176485, 0.999158, -1.04308e-07, 0.171389, 5.96046e-08 )
+bones/24/enabled = true
+bones/24/bound_children = [ ]
+bones/25/name = "Ringfinger.L"
+bones/25/parent = 18
+bones/25/rest = Transform( 0.996881, 0.029496, -0.0731969, -0.00553319, 0.951366, 0.308013, 0.0787223, -0.306647, 0.948562, -0.0474181, 0.585947, -0.124826 )
+bones/25/enabled = true
+bones/25/bound_children = [ ]
+bones/26/name = "RingfingerJoint.L"
+bones/26/parent = 25
+bones/26/rest = Transform( 0.993601, 0.107312, -0.0352211, -0.107189, 0.994224, 0.0053527, 0.0355921, -0.00154313, 0.999365, 0, 0.148602, 1.67638e-08 )
+bones/26/enabled = true
+bones/26/bound_children = [ ]
+bones/27/name = "Pinky.L"
+bones/27/parent = 18
+bones/27/rest = Transform( 0.956205, 0.152718, -0.249696, 0.0177501, 0.821265, 0.570271, 0.292158, -0.549728, 0.782587, -0.0680351, 0.524245, -0.176284 )
+bones/27/enabled = true
+bones/27/bound_children = [ ]
+
+[node name="arms" type="MeshInstance" parent="Skeleton"]
+mesh = ExtResource( 3 )
+skin = ExtResource( 4 )
+
+[node name="GunBone" type="BoneAttachment" parent="Skeleton"]
+transform = Transform( -0.978, -0.15941, 0.134542, 0.1673, -0.214165, 0.962363, -0.124596, 0.963702, 0.236124, -1.28918, -0.187637, 3.05885 )
+bone_name = "Wrist.R"