From ca4c7153e534a8ae8a2df284d98706b350fd8e19 Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Thu, 25 Jul 2024 19:12:36 -0600 Subject: [PATCH] Added railgun/rifle weapon --- assets/models/bipedal_mech/mech.tscn | 118 +++++------ project.godot | 12 ++ src/effects/glint/glint.gdshader | 38 ++++ src/effects/glint/glint.tscn | 88 +++++++++ src/effects/rifle_beam/rifle_beam.gd | 16 ++ src/effects/rifle_beam/rifle_beam.tscn | 98 +++++++++ .../rifle_beam/rifle_beam_material.tres | 21 ++ src/effects/spent_casing.tscn | 4 +- src/equip/{ => autocannon}/autocannon.gd | 15 +- src/equip/{ => autocannon}/autocannon.tscn | 16 +- src/equip/rifle/rifle.gd | 56 ++++++ src/equip/rifle/rifle.tscn | 186 ++++++++++++++++++ src/equip/rifle/rifle_metal.tres | 30 +++ src/equip/weapon.gd | 4 + src/game_state.gd | 5 + src/maps/arena_map/arena_map.gd | 5 + src/maps/arena_map/arena_map.tscn | 16 +- src/player/player.gd | 37 +++- src/player/player.tscn | 129 ++++++------ src/shaders/plasma_morph.gdshader | 20 ++ src/shaders/spatial_threshold.gdshader | 9 +- 21 files changed, 773 insertions(+), 150 deletions(-) create mode 100644 src/effects/glint/glint.gdshader create mode 100644 src/effects/glint/glint.tscn create mode 100644 src/effects/rifle_beam/rifle_beam.gd create mode 100644 src/effects/rifle_beam/rifle_beam.tscn create mode 100644 src/effects/rifle_beam/rifle_beam_material.tres rename src/equip/{ => autocannon}/autocannon.gd (78%) rename src/equip/{ => autocannon}/autocannon.tscn (91%) create mode 100644 src/equip/rifle/rifle.gd create mode 100644 src/equip/rifle/rifle.tscn create mode 100644 src/equip/rifle/rifle_metal.tres create mode 100644 src/maps/arena_map/arena_map.gd create mode 100644 src/shaders/plasma_morph.gdshader diff --git a/assets/models/bipedal_mech/mech.tscn b/assets/models/bipedal_mech/mech.tscn index 8bbb963..b88281d 100644 --- a/assets/models/bipedal_mech/mech.tscn +++ b/assets/models/bipedal_mech/mech.tscn @@ -1329,43 +1329,43 @@ parameters/walk_scale/scale = 1.0 parameters/walk_space/blend_position = Vector2(0, 0) [node name="Skeleton3D" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5" index="0"] -bones/1/position = Vector3(0, 0, 6.22888) +bones/1/position = Vector3(0, 0, 6.40972) bones/1/rotation = Quaternion(0.707107, 0, 0, 0.707107) bones/2/rotation = Quaternion(1.54543e-08, 1.54543e-08, -0.707107, 0.707107) -bones/3/rotation = Quaternion(0.650943, 0.670731, 0.247765, 0.254961) +bones/3/rotation = Quaternion(0.6545, 0.673955, 0.238857, 0.245687) bones/3/scale = Vector3(1, 1, 1) -bones/4/rotation = Quaternion(0.737087, 0.0535668, 0.0763486, 0.669331) +bones/4/rotation = Quaternion(0.707726, 0.0557263, 0.0732245, 0.700469) bones/4/scale = Vector3(1, 1, 1) -bones/5/rotation = Quaternion(-0.652932, -0.00101165, -0.105891, 0.749977) +bones/5/rotation = Quaternion(-0.627934, -0.00132872, -0.1023, 0.771513) bones/5/scale = Vector3(1, 1, 1) -bones/6/rotation = Quaternion(-0.430725, 0.0118466, -0.0624951, 0.900239) -bones/7/rotation = Quaternion(-0.85053, 0.0348597, -0.176768, 0.494101) +bones/6/rotation = Quaternion(-0.434308, 0.0114673, -0.0627543, 0.898503) +bones/7/rotation = Quaternion(-0.842092, 0.0363255, -0.17425, 0.509116) bones/7/scale = Vector3(1, 1, 1) bones/9/rotation = Quaternion(-0.577893, -0.0977404, -0.0868737, 0.805568) -bones/11/rotation = Quaternion(-0.847169, 0.0411824, -0.172269, 0.50093) +bones/11/rotation = Quaternion(-0.83853, 0.042948, -0.169712, 0.515966) bones/11/scale = Vector3(1, 1, 1) bones/13/rotation = Quaternion(-0.583833, -0.0928994, -0.0936977, 0.80108) bones/13/scale = Vector3(1, 1, 1) bones/15/rotation = Quaternion(0.993231, -0.0067672, 0.0811647, 0.0828119) bones/15/scale = Vector3(1, 1, 1) -bones/17/rotation = Quaternion(0.750942, 0.0224669, 0.65936, 0.0287472) +bones/17/rotation = Quaternion(0.751912, 0.0122088, 0.659023, 0.0129839) bones/17/scale = Vector3(1, 1, 1) bones/19/rotation = Quaternion(-0.399104, -0.525183, -0.304683, 0.687072) bones/19/scale = Vector3(0.999999, 1, 1) bones/21/rotation = Quaternion(0.855906, -0.0322478, 0.0593455, 0.512701) -bones/23/rotation = Quaternion(0.869441, 0.00331343, 0.14354, 0.472713) +bones/23/rotation = Quaternion(0.894641, 0.00342101, 0.147694, 0.421653) bones/23/scale = Vector3(1, 1, 1) bones/25/rotation = Quaternion(-0.715396, -0.0713077, -0.0634678, 0.692168) bones/25/scale = Vector3(1, 1, 1) -bones/27/rotation = Quaternion(-0.598704, -0.00499813, -0.109321, 0.79346) +bones/27/rotation = Quaternion(-0.563131, -0.00562345, -0.104296, 0.819741) bones/29/rotation = Quaternion(0.808854, -0.0303334, 0.0651724, 0.583599) bones/31/rotation = Quaternion(0.808854, -0.0303334, 0.0651724, 0.583599) -bones/33/rotation = Quaternion(-0.59128, -0.00909081, -0.114231, 0.798284) -bones/35/rotation = Quaternion(-0.678808, 0.00411817, -0.109739, 0.726058) +bones/33/rotation = Quaternion(-0.555357, -0.0097424, -0.109336, 0.824335) +bones/35/rotation = Quaternion(-0.642464, 0.00373066, -0.10436, 0.759168) bones/35/scale = Vector3(1, 1, 1) bones/37/scale = Vector3(1, 1, 1) bones/39/scale = Vector3(1, 1, 1) -bones/41/rotation = Quaternion(-0.0150671, 0.942013, 0.335018, 0.0121359) +bones/41/rotation = Quaternion(-0.0148455, 0.936712, 0.349578, 0.0120532) bones/41/scale = Vector3(1, 1, 1) bones/43/rotation = Quaternion(-0.015884, 0.718179, -0.69565, -0.00621676) bones/43/scale = Vector3(1, 1, 1) @@ -1388,37 +1388,37 @@ bones/66/rotation = Quaternion(-0.000385918, -2.26638e-14, 0.000401128, 1) bones/68/rotation = Quaternion(-0.706834, 0.000283644, -0.000283644, 0.70738) bones/70/rotation = Quaternion(-0.707107, 4.67924e-24, 4.67924e-24, 0.707107) bones/73/rotation = Quaternion(1.54543e-08, -1.54543e-08, 0.707107, 0.707107) -bones/74/rotation = Quaternion(-0.650943, 0.670731, 0.247765, -0.254961) +bones/74/rotation = Quaternion(-0.6545, 0.673955, 0.238857, -0.245687) bones/74/scale = Vector3(1, 1, 1) -bones/75/rotation = Quaternion(0.737087, -0.0535668, -0.0763486, 0.669331) +bones/75/rotation = Quaternion(0.707726, -0.0557263, -0.0732245, 0.700469) bones/75/scale = Vector3(1, 1, 1) -bones/76/rotation = Quaternion(-0.652932, 0.00101167, 0.105891, 0.749977) +bones/76/rotation = Quaternion(-0.627934, 0.00132873, 0.1023, 0.771513) bones/76/scale = Vector3(1, 1, 1) -bones/77/rotation = Quaternion(-0.430725, -0.0118466, 0.062495, 0.900239) +bones/77/rotation = Quaternion(-0.434308, -0.0114673, 0.0627543, 0.898503) bones/77/scale = Vector3(1, 1, 1) -bones/78/rotation = Quaternion(-0.850535, -0.0349077, 0.176691, 0.494117) +bones/78/rotation = Quaternion(-0.842092, -0.0363256, 0.17425, 0.509116) bones/78/scale = Vector3(1, 1, 1) -bones/82/rotation = Quaternion(-0.847169, -0.0411825, 0.172269, 0.500931) +bones/82/rotation = Quaternion(-0.83853, -0.042952, 0.169711, 0.515966) bones/82/scale = Vector3(1, 1, 1) bones/84/rotation = Quaternion(-0.583833, 0.0928994, 0.0936978, 0.80108) bones/86/rotation = Quaternion(0.993231, 0.0067672, -0.0811647, 0.0828119) bones/86/scale = Vector3(1, 1, 1) -bones/88/rotation = Quaternion(0.750942, -0.0224667, -0.65936, 0.0287476) +bones/88/rotation = Quaternion(0.751904, -0.0122224, -0.659031, 0.0130061) bones/92/rotation = Quaternion(0.855906, 0.0322478, -0.0593455, 0.512701) bones/92/scale = Vector3(1, 1, 1) -bones/94/rotation = Quaternion(0.869441, -0.00331339, -0.14354, 0.472713) +bones/94/rotation = Quaternion(0.894641, -0.00342097, -0.147694, 0.421653) bones/94/scale = Vector3(1, 1, 1) bones/96/rotation = Quaternion(-0.715396, 0.0713076, 0.0634679, 0.692168) -bones/98/rotation = Quaternion(-0.598703, 0.00499814, 0.109321, 0.79346) +bones/98/rotation = Quaternion(-0.56313, 0.00562343, 0.104296, 0.819741) bones/100/rotation = Quaternion(0.808854, 0.0303333, -0.0651724, 0.583599) -bones/102/rotation = Quaternion(-0.59128, 0.00909082, 0.114231, 0.798284) +bones/102/rotation = Quaternion(-0.555357, 0.00974239, 0.109336, 0.824335) bones/102/scale = Vector3(1, 1, 1) bones/104/rotation = Quaternion(0.803479, 0.0249214, -0.0691385, 0.590779) -bones/106/rotation = Quaternion(-0.678808, -0.00411817, 0.109739, 0.726058) +bones/106/rotation = Quaternion(-0.642464, -0.00373064, 0.10436, 0.759168) bones/106/scale = Vector3(1, 1, 1) bones/108/scale = Vector3(1, 1, 1) bones/110/rotation = Quaternion(0.346017, 0.0755612, -0.0156624, 0.935049) -bones/112/rotation = Quaternion(0.0150671, 0.942013, 0.335018, -0.0121359) +bones/112/rotation = Quaternion(0.0148455, 0.936712, 0.349578, -0.0120532) bones/112/scale = Vector3(1, 1, 1) bones/114/rotation = Quaternion(0.015884, 0.718179, -0.69565, 0.00621692) bones/114/scale = Vector3(1, 1, 1) @@ -1434,67 +1434,67 @@ bones/126/rotation = Quaternion(0.993232, 0.00676712, -0.0811637, -0.0828125) bones/126/scale = Vector3(1, 1, 0.999988) [node name="Plane_009_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="0"] -transform = Transform3D(0.999992, 0.000212654, 0.00411356, -0.000399575, 0.998965, 0.0455022, -0.00409944, -0.0455037, 0.998956, -0.0143213, -0.0209339, 0.0578216) +transform = Transform3D(1, 0.000267118, 0.000898585, -0.00027664, 0.999944, 0.0106432, -0.000895657, -0.0106436, 0.999943, -0.00385928, -0.00843066, 0.013431) [node name="Plane_012_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="1"] -transform = Transform3D(0.999989, 0.00100544, 0.00449461, -0.00121042, 0.998948, 0.045842, -0.00444363, -0.0458472, 0.998938, -0.0154314, -0.0195891, 0.0576616) +transform = Transform3D(0.999999, 0.000382468, 0.000957824, -0.000392735, 0.999942, 0.0107229, -0.0009536, -0.0107234, 0.999942, -0.00402284, -0.00836092, 0.0134232) [node name="Cube_016_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="2"] -transform = Transform3D(0.999998, -0.000592936, 0.00191464, 0.000592953, 1, 1.24425e-05, -0.00191447, -1.14292e-05, 0.999998, -0.0116918, 0.012762, 0.00379586) +transform = Transform3D(1, -5.53392e-06, 0.000526115, 5.54137e-06, 1, 2.07275e-05, -0.000526085, -2.08467e-05, 1, -0.00327516, -0.000553101, 0.00146535) [node name="Plane_004_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="3"] -transform = Transform3D(0.999993, -0.0016899, 0.00307968, 0.00150892, 0.998323, 0.0578658, -0.00317211, -0.0578608, 0.99832, -0.0117965, -0.055868, 0.0193377) +transform = Transform3D(0.999999, 0.000631958, 0.000308774, -0.000635624, 0.999924, 0.0123076, -0.000300974, -0.012308, 0.999924, -0.00284076, -0.0111008, 0.00213385) [node name="Cube_013_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="4"] -transform = Transform3D(0.999995, -0.000562087, 0.00310817, 0.00052458, 0.999928, 0.0120655, -0.00311453, -0.0120639, 0.999922, -0.0121355, 0.00831962, 0.00515246) +transform = Transform3D(1, -1.07288e-06, 0.000838861, -2.36183e-06, 0.999992, 0.00410733, -0.000838831, -0.00410739, 0.999991, -0.00339341, -0.002105, 0.00162029) [node name="Plane_011_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="5"] -transform = Transform3D(0.999998, -0.00185052, -0.000771184, 0.0019031, 0.997191, 0.0748795, 0.000630645, -0.0748807, 0.997192, 0.00745201, -0.447649, -0.0121031) +transform = Transform3D(1, -0.000363827, -0.000343303, 0.000370368, 0.999815, 0.0192287, 0.000336325, -0.0192289, 0.999815, 0.00259399, -0.116043, -0.00544882) [node name="Plane_002_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="6"] -transform = Transform3D(0.999994, 0.00112599, 0.00334246, -0.0012705, 0.999051, 0.0435556, -0.00329005, -0.0435596, 0.999046, -0.0152929, -0.00381112, 0.0920889) +transform = Transform3D(1, 0.000444025, 0.000918821, -0.000455856, 0.999916, 0.0129632, -0.000912927, -0.0129637, 0.999916, -0.00431657, -0.00657821, 0.0246847) [node name="Plane_013_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="7"] -transform = Transform3D(0.999994, 0.00112599, 0.00334246, -0.0012705, 0.999051, 0.0435556, -0.00329005, -0.0435596, 0.999046, -0.0152929, -0.00381112, 0.0920889) +transform = Transform3D(1, 0.000444025, 0.000918821, -0.000455856, 0.999916, 0.0129632, -0.000912927, -0.0129637, 0.999916, -0.00431657, -0.00657821, 0.0246847) [node name="Cube_007_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="8"] -transform = Transform3D(0.999996, -0.000943512, 0.00278079, 0.000785924, 0.998423, 0.0561427, -0.00282919, -0.0561403, 0.998419, -0.0115888, -0.0499271, 0.0197608) +transform = Transform3D(1, -3.22759e-05, 0.000730753, 2.08393e-05, 0.999877, 0.0156718, -0.000731125, -0.0156718, 0.999877, -0.00323963, -0.0176303, 0.00451088) [node name="Plane_015_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="9"] -transform = Transform3D(0.999992, -0.00018011, 0.00397366, 0.0004884, 0.996976, -0.077711, -0.00394747, 0.0777123, 0.996968, -0.0147531, 0.244853, -0.0727143) +transform = Transform3D(0.999999, 5.22286e-06, 0.00109132, 1.59293e-05, 0.999812, -0.0193631, -0.00109117, 0.019363, 0.999812, -0.00405598, 0.0590628, -0.0201688) [node name="Cube_010_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="10"] -transform = Transform3D(1, -0.000164622, -0.00101974, 0.000241531, 0.997122, 0.075823, 0.0010045, -0.0758232, 0.997121, 0.0065403, -0.454012, -0.18043) +transform = Transform3D(1, 1.73971e-06, -0.000189549, 1.6056e-06, 0.999848, 0.0174577, 0.00018961, -0.0174576, 0.999848, 0.0012598, -0.106368, -0.0500879) [node name="Cube_012_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="11"] -transform = Transform3D(1, -0.000416992, -0.000725152, 0.000444401, 0.999273, 0.0381286, 0.000708899, -0.0381289, 0.999273, 0.00502467, -0.246602, -0.208982) +transform = Transform3D(1, -8.96792e-05, -0.000195889, 9.18011e-05, 0.999943, 0.0106924, 0.000194983, -0.0106924, 0.999943, 0.00133801, -0.0691778, -0.0537863) [node name="Cylinder_002_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="12"] -transform = Transform3D(1, -1.77636e-15, 0, -1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.243319) +transform = Transform3D(1, -1.77636e-15, 0, -1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.062479) [node name="Cube_006_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="13"] -transform = Transform3D(1, 7.18785e-10, -2.03527e-08, -7.31035e-10, 1, -1.49128e-07, 2.02767e-08, 1.78756e-07, 1, -1.19209e-07, -1.43051e-06, -0.24332) +transform = Transform3D(1, 7.18785e-10, -2.03527e-08, -7.31035e-10, 1, -1.49128e-07, 2.02767e-08, 1.78756e-07, 1, -1.19209e-07, -1.43051e-06, -0.06248) [node name="Cube_017_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="14"] -transform = Transform3D(1, 3.1531e-10, 2.16907e-08, -3.26025e-10, 1, -1.19326e-07, -2.17319e-08, 1.78814e-07, 1, 1.19209e-07, -1.90735e-06, -0.243321) +transform = Transform3D(1, 3.1531e-10, 2.16907e-08, -3.26025e-10, 1, -1.19326e-07, -2.17319e-08, 1.78814e-07, 1, 1.19209e-07, -1.90735e-06, -0.0624809) [node name="Cube_005_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="15"] -transform = Transform3D(1, -1.42109e-13, -3.41061e-13, 2.27374e-13, 1, -9.23872e-07, 3.97904e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.243321) +transform = Transform3D(1, -1.42109e-13, -3.41061e-13, 2.27374e-13, 1, -9.23872e-07, 3.97904e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.0624809) [node name="Cube_005_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D/Cube_005_Material_0" index="0"] surface_material_override/0 = ExtResource("8_dt6e4") [node name="Cube_005_Inside_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="16"] -transform = Transform3D(1, -1.42109e-13, -3.41061e-13, 2.27374e-13, 1, -9.23872e-07, 3.97904e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.243321) +transform = Transform3D(1, -1.42109e-13, -3.41061e-13, 2.27374e-13, 1, -9.23872e-07, 3.97904e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.0624809) [node name="Plane_003_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="17"] -transform = Transform3D(1, 1.0877e-10, -1.02383e-08, -1.10134e-10, 1, -2.82831e-07, 1.02508e-08, 2.82773e-07, 1, -2.38419e-07, 0, -0.243319) +transform = Transform3D(1, 1.0877e-10, -1.02383e-08, -1.10134e-10, 1, -2.82831e-07, 1.02508e-08, 2.82773e-07, 1, -2.38419e-07, 0, -0.062479) [node name="Plane_016_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="18"] -transform = Transform3D(1, -1.0877e-10, 1.02383e-08, 1.10134e-10, 1, -2.82831e-07, -1.02508e-08, 2.82773e-07, 1, 2.38419e-07, 0, -0.243319) +transform = Transform3D(1, -1.0877e-10, 1.02383e-08, 1.10134e-10, 1, -2.82831e-07, -1.02508e-08, 2.82773e-07, 1, 2.38419e-07, 0, -0.062479) [node name="Cube_008_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="19"] -transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.243319) +transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.062479) [node name="Blackout" type="Node3D" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D/Cube_008_Material_0" index="1"] visible = false @@ -1541,43 +1541,43 @@ mesh = SubResource("PlaneMesh_fbdqo") skeleton = NodePath("../..") [node name="Cube_008_Inside_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="20"] -transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.243319) +transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.062479) [node name="Plane_006_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="21"] -transform = Transform3D(0.999992, -0.000243962, -0.00393721, 0.000422657, 0.998967, 0.0454589, 0.00392184, -0.0454604, 0.998959, 0.0142076, -0.0208176, 0.0571525) +transform = Transform3D(1, -0.000267074, -0.000898413, 0.000276595, 0.999944, 0.0106443, 0.000895493, -0.0106447, 0.999943, 0.00385976, -0.00843114, 0.013431) [node name="Plane_008_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="22"] -transform = Transform3D(0.99999, -0.00100565, -0.00449483, 0.00121064, 0.998949, 0.0458405, 0.00444385, -0.0458454, 0.998939, 0.0154328, -0.0195872, 0.0576596) +transform = Transform3D(1, -0.000377953, -0.000951141, 0.000388071, 0.999943, 0.0107225, 0.000947006, -0.010723, 0.999942, 0.00401378, -0.00837404, 0.0134035) [node name="Cube_004_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="23"] -transform = Transform3D(0.999998, 0.000592817, -0.00191478, -0.000592818, 1, 1.25021e-05, 0.00191462, -1.13994e-05, 0.999998, 0.0116918, 0.0127624, 0.00379586) +transform = Transform3D(1, 5.53392e-06, -0.000526115, -5.56745e-06, 1, 2.07573e-05, 0.000526085, -2.08765e-05, 1, 0.00327468, -0.00055328, 0.00146514) [node name="Plane_005_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="24"] -transform = Transform3D(0.999994, 0.00169002, -0.00307842, -0.00150859, 0.998324, 0.057866, 0.00317053, -0.0578612, 0.99832, 0.0118001, -0.0558684, 0.0193352) +transform = Transform3D(1, -0.000611573, -0.000317462, 0.000616089, 0.999924, 0.0123594, 0.000309438, -0.0123599, 0.999923, 0.00285268, -0.0112333, 0.00217712) [node name="Cube_003_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="25"] -transform = Transform3D(0.999995, 0.000562131, -0.00310815, -0.000524625, 0.999927, 0.0120656, 0.00311453, -0.0120638, 0.999922, 0.012135, 0.00831985, 0.00515223) +transform = Transform3D(1, 1.06543e-06, -0.000838868, 2.33948e-06, 0.999992, 0.00410733, 0.000838824, -0.00410733, 0.999991, 0.00339293, -0.00210482, 0.00162029) [node name="Plane_007_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="26"] -transform = Transform3D(0.999998, 0.00185046, 0.00077097, -0.00190306, 0.997191, 0.0748795, -0.000630434, -0.0748807, 0.997193, -0.00744939, -0.447649, -0.0121021) +transform = Transform3D(1, 0.000363782, 0.00034309, -0.000370353, 0.999815, 0.0192286, -0.000336101, -0.0192289, 0.999815, -0.00259161, -0.116043, -0.00544786) [node name="Plane_014_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="27"] -transform = Transform3D(0.999994, -0.00112623, -0.00334232, 0.00127071, 0.99905, 0.0435542, 0.00328988, -0.0435582, 0.999046, 0.0152934, -0.00380766, 0.0920863) +transform = Transform3D(1, -0.000444278, -0.000918664, 0.000456154, 0.999916, 0.0129615, 0.000912782, -0.0129621, 0.999915, 0.00431705, -0.00657415, 0.0246825) [node name="Plane_010_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="28"] -transform = Transform3D(0.999992, -0.00193878, -0.00356964, 0.00209358, 0.999034, 0.0439004, 0.00348089, -0.0439075, 0.99903, 0.0168588, -0.00386977, 0.0909214) +transform = Transform3D(1, -0.000701025, -0.000946913, 0.000713319, 0.999915, 0.013054, 0.000937644, -0.0130549, 0.999914, 0.00472212, -0.00650215, 0.0242963) [node name="Cube_014_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="29"] -transform = Transform3D(0.999996, 0.000943378, -0.002781, -0.000785768, 0.998422, 0.056143, 0.0028294, -0.0561406, 0.998419, 0.0115895, -0.0499266, 0.0197616) +transform = Transform3D(1, 3.21716e-05, -0.000730954, -2.07424e-05, 0.999877, 0.015672, 0.000731334, -0.015672, 0.999877, 0.00324011, -0.0176302, 0.00451183) [node name="Plane_001_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="30"] -transform = Transform3D(0.999992, 0.000180095, -0.00397351, -0.000488386, 0.996976, -0.0777112, 0.00394733, 0.0777125, 0.996968, 0.0147533, 0.244854, -0.0727148) +transform = Transform3D(1, -5.23031e-06, -0.00109117, -1.59293e-05, 0.999813, -0.0193633, 0.00109103, 0.0193632, 0.999812, 0.00405574, 0.0590631, -0.0201693) [node name="Cube_015_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="31"] -transform = Transform3D(1, 0.000164399, 0.00101951, -0.000241293, 0.997122, 0.075823, -0.00100429, -0.0758232, 0.997121, -0.00653887, -0.454011, -0.180429) +transform = Transform3D(1, -1.96323e-06, 0.000189319, -1.38022e-06, 0.999848, 0.0174577, -0.000189384, -0.0174576, 0.999848, -0.00125837, -0.106367, -0.0500879) [node name="Cube_001_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="32"] -transform = Transform3D(1, 0.000416983, 0.000725171, -0.000444393, 0.999273, 0.0381286, -0.000708919, -0.0381289, 0.999273, -0.00502515, -0.246602, -0.208982) +transform = Transform3D(1, 8.96699e-05, 0.000195908, -9.17925e-05, 0.999943, 0.0106924, -0.000195003, -0.0106924, 0.999943, -0.00133848, -0.0691773, -0.0537868) [node name="Cylinder_001_Material_0" parent="Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="33"] -transform = Transform3D(1, 1.77636e-15, 0, 1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.243319) +transform = Transform3D(1, 1.77636e-15, 0, 1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.062479) diff --git a/project.godot b/project.godot index 6ee8a4c..d572b89 100644 --- a/project.godot +++ b/project.godot @@ -88,6 +88,18 @@ boost={ , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":true,"script":null) ] } +weapon_trigger={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":1,"canceled":false,"pressed":false,"double_click":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":5,"axis_value":1.0,"script":null) +] +} +weapon_alt={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":2,"position":Vector2(209, 12),"global_position":Vector2(213, 53),"factor":1.0,"button_index":2,"canceled":false,"pressed":true,"double_click":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":4,"axis_value":1.0,"script":null) +] +} [layer_names] diff --git a/src/effects/glint/glint.gdshader b/src/effects/glint/glint.gdshader new file mode 100644 index 0000000..9e7e646 --- /dev/null +++ b/src/effects/glint/glint.gdshader @@ -0,0 +1,38 @@ +shader_type spatial; +render_mode unshaded; + +uniform vec4 fill_color: source_color = vec4(1.0, 1.0, 1.0, 1.0); +uniform vec4 bg_color: source_color = vec4(0.0, 0.0, 0.0, 0.0); +uniform vec4 outline_color: source_color = vec4(0.0, 0.0, 0.0, 1.0); + +uniform float scale = 2.0; +uniform float rotation = 0.0; +uniform float outline_width = 0.03; + + +void vertex() { + float sine = sin(rotation); + float cosine = cos(rotation); + // Billboarding + MODELVIEW_MATRIX = VIEW_MATRIX * mat4(INV_VIEW_MATRIX[0], INV_VIEW_MATRIX[1], INV_VIEW_MATRIX[2], MODEL_MATRIX[3]); + // Scale + MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(vec4(length(MODEL_MATRIX[0].xyz), 0.0, 0.0, 0.0), vec4(0.0, length(MODEL_MATRIX[1].xyz), 0.0, 0.0), vec4(0.0, 0.0, length(MODEL_MATRIX[2].xyz), 0.0), vec4(0.0, 0.0, 0.0, 1.0)); + // Rotation + MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(vec4(cosine, -sine, 0.0, 0.0), vec4(sine, cosine, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); + + MODELVIEW_NORMAL_MATRIX = mat3(MODELVIEW_MATRIX); +} + +void fragment() { + vec2 pt = abs(scale * (UV - 0.5)); + float curve = sqrt(pt.x) + sqrt(pt.y); + vec4 color = bg_color; + if (curve < 1.0 + outline_width) { + color = outline_color; + if (curve < 1.0) { + color = fill_color; + } + } + ALBEDO.rgb = color.rgb; + ALPHA = color.a; +} \ No newline at end of file diff --git a/src/effects/glint/glint.tscn b/src/effects/glint/glint.tscn new file mode 100644 index 0000000..f840333 --- /dev/null +++ b/src/effects/glint/glint.tscn @@ -0,0 +1,88 @@ +[gd_scene load_steps=7 format=3 uid="uid://bw5isfysmrbal"] + +[ext_resource type="Shader" path="res://src/effects/glint/glint.gdshader" id="1_nou6p"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_puof4"] +render_priority = 0 +shader = ExtResource("1_nou6p") +shader_parameter/fill_color = Color(1, 1, 1, 1) +shader_parameter/bg_color = Color(0, 0, 0, 0) +shader_parameter/outline_color = Color(0, 0, 0, 1) +shader_parameter/scale = 2.0 +shader_parameter/rotation = 0.0 +shader_parameter/outline_width = 0.03 + +[sub_resource type="QuadMesh" id="QuadMesh_8og0q"] +material = SubResource("ShaderMaterial_puof4") +size = Vector2(4, 4) + +[sub_resource type="Animation" id="Animation_50few"] +resource_name = "grow" +length = 2.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Mesh:scale") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1.5, 2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(1.25, 1.25, 1.25), Vector3(1, 1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Mesh:mesh:material:shader_parameter/rotation") +tracks/1/interp = 2 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 1.2, 1.4, 2), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 0, +"values": [0.0, 3.14, 6.28, 9.42] +} + +[sub_resource type="Animation" id="Animation_y26tx"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Mesh:scale") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(1, 1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Mesh:mesh:material:shader_parameter/rotation") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_5be8s"] +_data = { +"RESET": SubResource("Animation_y26tx"), +"grow": SubResource("Animation_50few") +} + +[node name="Glint" type="Node3D"] + +[node name="Mesh" type="MeshInstance3D" parent="."] +mesh = SubResource("QuadMesh_8og0q") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_5be8s") +} diff --git a/src/effects/rifle_beam/rifle_beam.gd b/src/effects/rifle_beam/rifle_beam.gd new file mode 100644 index 0000000..51b9da8 --- /dev/null +++ b/src/effects/rifle_beam/rifle_beam.gd @@ -0,0 +1,16 @@ +class_name RifleBeam +extends Node3D + +@export var endpoint: Vector3 + +@onready var mesh: MeshInstance3D = $Mesh + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + var length: float = (endpoint - global_position).length() + mesh.position.z = -length / 2.0 + var cylinder: CylinderMesh = mesh.mesh + cylinder.height = length + + (cylinder.material as ShaderMaterial).set_shader_parameter("y_scale", length) diff --git a/src/effects/rifle_beam/rifle_beam.tscn b/src/effects/rifle_beam/rifle_beam.tscn new file mode 100644 index 0000000..c344a8b --- /dev/null +++ b/src/effects/rifle_beam/rifle_beam.tscn @@ -0,0 +1,98 @@ +[gd_scene load_steps=10 format=3 uid="uid://bnj8nokkrrd7d"] + +[ext_resource type="Script" path="res://src/effects/rifle_beam/rifle_beam.gd" id="1_gqjmp"] +[ext_resource type="Shader" path="res://src/shaders/plasma_morph.gdshader" id="2_01uhq"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_6o211"] +frequency = 0.0867 +fractal_type = 3 + +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_bk82q"] +height = 256 +seamless = true +noise = SubResource("FastNoiseLite_6o211") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_igb6u"] +resource_local_to_scene = true +render_priority = 0 +shader = ExtResource("2_01uhq") +shader_parameter/color_low = Color(0, 0, 0, 0) +shader_parameter/color_hi = Color(1, 1, 1, 1) +shader_parameter/threshold = 0.0 +shader_parameter/speed = 0.05 +shader_parameter/y_scale = 1.0 +shader_parameter/noise = SubResource("NoiseTexture3D_bk82q") + +[sub_resource type="CylinderMesh" id="CylinderMesh_ioxey"] +resource_local_to_scene = true +material = SubResource("ShaderMaterial_igb6u") +top_radius = 0.1 +bottom_radius = 0.1 +height = 1.0 +cap_top = false +cap_bottom = false + +[sub_resource type="Animation" id="Animation_lurf0"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Mesh:mesh:material:shader_parameter/threshold") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="Animation" id="Animation_yucts"] +resource_name = "fade_out" +length = 3.0 +tracks/0/type = "method" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath(".") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(3), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"queue_free" +}] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Mesh:mesh:material:shader_parameter/threshold") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 3), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, 1.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_xct5s"] +_data = { +"RESET": SubResource("Animation_lurf0"), +"fade_out": SubResource("Animation_yucts") +} + +[node name="RifleBeam" type="Node3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5) +script = ExtResource("1_gqjmp") + +[node name="Mesh" type="MeshInstance3D" parent="."] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0) +mesh = SubResource("CylinderMesh_ioxey") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_xct5s") +} +autoplay = "fade_out" diff --git a/src/effects/rifle_beam/rifle_beam_material.tres b/src/effects/rifle_beam/rifle_beam_material.tres new file mode 100644 index 0000000..7e88b25 --- /dev/null +++ b/src/effects/rifle_beam/rifle_beam_material.tres @@ -0,0 +1,21 @@ +[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://d3t67pxe0glv"] + +[ext_resource type="Shader" path="res://src/shaders/plasma_morph.gdshader" id="1_plbm5"] + +[sub_resource type="FastNoiseLite" id="FastNoiseLite_uuqgf"] +frequency = 0.0867 +fractal_type = 3 + +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_alkmg"] +height = 256 +seamless = true +noise = SubResource("FastNoiseLite_uuqgf") + +[resource] +render_priority = 0 +shader = ExtResource("1_plbm5") +shader_parameter/color_low = Color(0, 0, 0, 0) +shader_parameter/color_hi = Color(1, 1, 1, 1) +shader_parameter/threshold = 0.0 +shader_parameter/speed = 0.05 +shader_parameter/noise = SubResource("NoiseTexture3D_alkmg") diff --git a/src/effects/spent_casing.tscn b/src/effects/spent_casing.tscn index a53e5f1..8786ba4 100644 --- a/src/effects/spent_casing.tscn +++ b/src/effects/spent_casing.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=3 uid="uid://d2rertco3018a"] -[ext_resource type="Material" uid="uid://dsc0g1qafw80e" path="res://src/maps/arena_map/metal_09.tres" id="1_xlnnn"] +[ext_resource type="Material" uid="uid://dh0kv86unablo" path="res://src/equip/rifle/rifle_metal.tres" id="1_nrm3c"] [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_5dqn0"] angle_min = -720.0 @@ -16,7 +16,7 @@ collision_friction = 0.0 collision_bounce = 0.27 [sub_resource type="CylinderMesh" id="CylinderMesh_ncrsd"] -material = ExtResource("1_xlnnn") +material = ExtResource("1_nrm3c") top_radius = 0.02 bottom_radius = 0.02 height = 0.1 diff --git a/src/equip/autocannon.gd b/src/equip/autocannon/autocannon.gd similarity index 78% rename from src/equip/autocannon.gd rename to src/equip/autocannon/autocannon.gd index 6d36000..9546258 100644 --- a/src/equip/autocannon.gd +++ b/src/equip/autocannon/autocannon.gd @@ -24,12 +24,10 @@ func fire() -> void: # First, raycast from camera (aimcast) to get what we're aiming at. # Then, raycast from muzzle to aimcast point to check the actual ballistic path. if aimcast.is_colliding(): + var past_target: Vector3 = 2 * aimcast.get_collision_point() - muzzle.global_position var collision: Dictionary = get_world_3d().direct_space_state.intersect_ray( PhysicsRayQueryParameters3D.create( - muzzle.global_position, - aimcast.get_collision_point(), - BULLET_COLLISION_MASK, - _excluded_rid + muzzle.global_position, past_target, BULLET_COLLISION_MASK, _excluded_rid ) ) if collision: @@ -47,4 +45,13 @@ func fire() -> void: func trigger() -> void: + animation_player.get_animation("fire").loop_mode = Animation.LOOP_LINEAR animation_player.play("fire") + + +func release() -> void: + animation_player.get_animation("fire").loop_mode = Animation.LOOP_NONE + + +func deactivate() -> void: + animation_player.get_animation("fire").loop_mode = Animation.LOOP_NONE diff --git a/src/equip/autocannon.tscn b/src/equip/autocannon/autocannon.tscn similarity index 91% rename from src/equip/autocannon.tscn rename to src/equip/autocannon/autocannon.tscn index 454ef34..a36a2f8 100644 --- a/src/equip/autocannon.tscn +++ b/src/equip/autocannon/autocannon.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=8 format=3 uid="uid://in6j0ylwrk7l"] -[ext_resource type="Material" uid="uid://7a1uvst7oef2" path="res://assets/textures/metal_plate_1k/metal_plate.tres" id="1_8ueic"] -[ext_resource type="Script" path="res://src/equip/autocannon.gd" id="1_bbfmi"] -[ext_resource type="PackedScene" uid="uid://d2rertco3018a" path="res://src/effects/spent_casing.tscn" id="3_tfu5g"] +[ext_resource type="Script" path="res://src/equip/autocannon/autocannon.gd" id="1_l08qo"] +[ext_resource type="Material" uid="uid://7a1uvst7oef2" path="res://assets/textures/metal_plate_1k/metal_plate.tres" id="2_rrwgh"] +[ext_resource type="PackedScene" uid="uid://d2rertco3018a" path="res://src/effects/spent_casing.tscn" id="3_ygb7l"] [sub_resource type="CylinderMesh" id="CylinderMesh_ldwsl"] -material = ExtResource("1_8ueic") +material = ExtResource("2_rrwgh") top_radius = 0.2 bottom_radius = 0.2 height = 4.0 @@ -34,7 +34,7 @@ tracks/1/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 1, -"values": [true] +"values": [false] } tracks/2/type = "value" tracks/2/imported = false @@ -64,6 +64,7 @@ tracks/3/keys = { [sub_resource type="Animation" id="Animation_sil41"] resource_name = "fire" length = 0.2 +loop_mode = 1 step = 0.01 tracks/0/type = "value" tracks/0/imported = false @@ -135,7 +136,7 @@ _data = { } [node name="Autocannon" type="Node3D"] -script = ExtResource("1_bbfmi") +script = ExtResource("1_l08qo") [node name="MeshInstance3D" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0) @@ -143,12 +144,13 @@ mesh = SubResource("CylinderMesh_ldwsl") [node name="OmniLight3D" type="OmniLight3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.1558) +visible = false light_energy = 16.0 light_size = 0.1 light_specular = 0.6 omni_range = 10.0 -[node name="SpentCasing" parent="." instance=ExtResource("3_tfu5g")] +[node name="SpentCasing" parent="." instance=ExtResource("3_ygb7l")] transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, -0.2, 0, -1.4) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] diff --git a/src/equip/rifle/rifle.gd b/src/equip/rifle/rifle.gd new file mode 100644 index 0000000..f3db866 --- /dev/null +++ b/src/equip/rifle/rifle.gd @@ -0,0 +1,56 @@ +extends Weapon + +const DAMAGE: float = 40.0 +const BULLET_COLLISION_MASK: int = 0x00000001 + +var _charged: bool = false + +@onready var animation_player: AnimationPlayer = $AnimationPlayer +@onready var muzzle: Node3D = $Muzzle + +@onready var aimcast: RayCast3D = get_tree().get_first_node_in_group("AimCastGroup") +@onready var rifle_beam_scene: PackedScene = load("res://src/effects/rifle_beam/rifle_beam.tscn") + + +func fire() -> void: + # XXX: can we refactor shared logic with autocannon? + if aimcast.is_colliding(): + var past_target: Vector3 = 2 * aimcast.get_collision_point() - muzzle.global_position + var collision: Dictionary = get_world_3d().direct_space_state.intersect_ray( + PhysicsRayQueryParameters3D.create( + muzzle.global_position, past_target, BULLET_COLLISION_MASK, _excluded_rid + ) + ) + if collision: + @warning_ignore("unsafe_cast") + var target: Node3D = collision["collider"] as Node3D + if target is DamageableBody: + (target as DamageableBody).deal_damage(DAMAGE) + + var beam: RifleBeam = rifle_beam_scene.instantiate() + var point: Vector3 = collision["position"] + beam.look_at_from_position(muzzle.global_position, point) + beam.endpoint = point + GameState.game_map.add_child(beam) + + +func trigger() -> void: + animation_player.play("charge") + + +func release() -> void: + if _charged: + _charged = false + print("WHAM!!!") + animation_player.play("fire") + fire() + else: + # sad trombone + animation_player.play_backwards("charge") + # DEBUG (REMOVEME) + fire() + + +func deactivate() -> void: + _charged = false + animation_player.stop() diff --git a/src/equip/rifle/rifle.tscn b/src/equip/rifle/rifle.tscn new file mode 100644 index 0000000..776093d --- /dev/null +++ b/src/equip/rifle/rifle.tscn @@ -0,0 +1,186 @@ +[gd_scene load_steps=10 format=3 uid="uid://csm36ra2445ho"] + +[ext_resource type="Script" path="res://src/equip/rifle/rifle.gd" id="1_55bob"] +[ext_resource type="Material" uid="uid://dh0kv86unablo" path="res://src/equip/rifle/rifle_metal.tres" id="1_hg6kg"] +[ext_resource type="Material" uid="uid://7a1uvst7oef2" path="res://assets/textures/metal_plate_1k/metal_plate.tres" id="2_lwmbe"] + +[sub_resource type="CapsuleMesh" id="CapsuleMesh_r5agj"] +material = ExtResource("1_hg6kg") +radius = 0.4 +height = 6.0 + +[sub_resource type="PrismMesh" id="PrismMesh_vhyv4"] +material = ExtResource("2_lwmbe") +size = Vector3(0.5, 0.2, 5) + +[sub_resource type="Animation" id="Animation_udx8y"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Node3D/CannonMesh:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector3(0, 0, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("OmniLight3D:light_energy") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("OmniLight3D:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} + +[sub_resource type="Animation" id="Animation_7xhb8"] +resource_name = "charge" +length = 8.0 +step = 0.0625 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Node3D/CannonMesh:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 8), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Vector3(0, 0, 0), Vector3(0, 0, -4)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("OmniLight3D:light_energy") +tracks/1/interp = 2 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 2, 4, 5, 6, 6.5, 7, 7.25, 7.5, 7.625, 7.75, 7.8125, 7.875, 7.9375, 8), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 0, +"values": [0.0, 8.0, 0.0, 8.0, 0.0, 8.0, 0.0, 8.0, 0.0, 8.0, 0.0, 8.0, 0.0, 8.0, 8.0] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("OmniLight3D:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/3/type = "method" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath(".") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(8), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [&"_charged", true], +"method": &"set" +}] +} + +[sub_resource type="Animation" id="Animation_6kn6d"] +resource_name = "charge" +length = 0.2 +step = 0.005 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Node3D/CannonMesh:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.04, 0.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Vector3(0, 0, -4), Vector3(0, 0, 0.5), Vector3(0, 0, 0)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("OmniLight3D:light_energy") +tracks/1/interp = 2 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.02, 0.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [8.0, 16.0, 0.0] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("OmniLight3D:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0, 0.2), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [true, false] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_oqhr1"] +_data = { +"RESET": SubResource("Animation_udx8y"), +"charge": SubResource("Animation_7xhb8"), +"fire": SubResource("Animation_6kn6d") +} + +[node name="Rifle" type="Node3D"] +script = ExtResource("1_55bob") + +[node name="Node3D" type="Node3D" parent="."] + +[node name="CannonMesh" type="MeshInstance3D" parent="Node3D"] +transform = Transform3D(0.3, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0) +mesh = SubResource("CapsuleMesh_r5agj") +skeleton = NodePath("../..") + +[node name="RailMesh" type="MeshInstance3D" parent="Node3D"] +transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0.195397, 0, 0) +mesh = SubResource("PrismMesh_vhyv4") + +[node name="OmniLight3D" type="OmniLight3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.1558) +visible = false +light_energy = 0.0 +light_size = 0.1 +light_specular = 0.6 +omni_range = 10.0 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_oqhr1") +} + +[node name="Muzzle" type="Node3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.5) diff --git a/src/equip/rifle/rifle_metal.tres b/src/equip/rifle/rifle_metal.tres new file mode 100644 index 0000000..9755fe1 --- /dev/null +++ b/src/equip/rifle/rifle_metal.tres @@ -0,0 +1,30 @@ +[gd_resource type="StandardMaterial3D" load_steps=8 format=3 uid="uid://dh0kv86unablo"] + +[ext_resource type="Texture2D" uid="uid://csbbhpwfxa6vi" path="res://assets/textures/Metal009_2K-PNG/Metal009_2K-PNG_Color.png" id="1_4atbb"] +[ext_resource type="Texture2D" uid="uid://c4cwawfg0jbdp" path="res://assets/textures/Metal009_2K-PNG/Metal009_2K-PNG_Displacement.png" id="2_63dc1"] +[ext_resource type="Texture2D" uid="uid://hme2odj58vo3" path="res://assets/textures/Metal009_2K-PNG/Metal009_2K-PNG_Metalness.png" id="3_pkkw2"] +[ext_resource type="Shader" path="res://src/shaders/spatial_threshold.gdshader" id="4_078v6"] +[ext_resource type="Texture2D" uid="uid://b63g40daehul" path="res://assets/textures/Metal009_2K-PNG/Metal009_2K-PNG_NormalGL.png" id="5_d7vkm"] +[ext_resource type="Texture2D" uid="uid://bjhtlrh1hij8x" path="res://assets/textures/Metal009_2K-PNG/Metal009_2K-PNG_Roughness.png" id="6_15ni8"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_52bij"] +render_priority = 0 +shader = ExtResource("4_078v6") +shader_parameter/color_low = Color(0, 0, 0, 1) +shader_parameter/color_hi = Color(1, 1, 1, 1) +shader_parameter/threshold = 0.029 +shader_parameter/contrast = 1.0 +shader_parameter/offset = 0.0 + +[resource] +next_pass = SubResource("ShaderMaterial_52bij") +albedo_texture = ExtResource("1_4atbb") +metallic = 1.0 +metallic_texture = ExtResource("3_pkkw2") +roughness_texture = ExtResource("6_15ni8") +normal_enabled = true +normal_texture = ExtResource("5_d7vkm") +heightmap_enabled = true +heightmap_scale = 1.0 +heightmap_texture = ExtResource("2_63dc1") +uv1_scale = Vector3(20, 20, 20) diff --git a/src/equip/weapon.gd b/src/equip/weapon.gd index 64dc80b..402d5ef 100644 --- a/src/equip/weapon.gd +++ b/src/equip/weapon.gd @@ -17,3 +17,7 @@ func trigger() -> void: func release() -> void: pass # Implemented in derived type + + +func deactivate() -> void: + pass # Implemented in derived type diff --git a/src/game_state.gd b/src/game_state.gd index a6e34ee..b005666 100644 --- a/src/game_state.gd +++ b/src/game_state.gd @@ -12,3 +12,8 @@ const SOLAR_HEAT_RATE: float = 0.005556 # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity: float = ProjectSettings.get_setting("physics/3d/default_gravity") + +var game_map: Node3D: + get: + assert(game_map, "Map accessed before game initialization!") + return game_map diff --git a/src/maps/arena_map/arena_map.gd b/src/maps/arena_map/arena_map.gd new file mode 100644 index 0000000..95d439b --- /dev/null +++ b/src/maps/arena_map/arena_map.gd @@ -0,0 +1,5 @@ +extends Node3D + + +func _ready() -> void: + GameState.game_map = self diff --git a/src/maps/arena_map/arena_map.tscn b/src/maps/arena_map/arena_map.tscn index 3dc6343..fc66e0a 100644 --- a/src/maps/arena_map/arena_map.tscn +++ b/src/maps/arena_map/arena_map.tscn @@ -1,15 +1,16 @@ [gd_scene load_steps=29 format=3 uid="uid://drbiyuustse8b"] +[ext_resource type="Script" path="res://src/maps/arena_map/arena_map.gd" id="1_5ols7"] [ext_resource type="PackedScene" uid="uid://bqp5mwyat3asv" path="res://src/player/player.tscn" id="1_tgee4"] [ext_resource type="Material" uid="uid://7a1uvst7oef2" path="res://assets/textures/metal_plate_1k/metal_plate.tres" id="2_ewgwm"] [ext_resource type="PackedScene" uid="uid://2vetjvn3w0si" path="res://src/npc/dummy/dummy.tscn" id="2_stkni"] [ext_resource type="Shader" path="res://src/shaders/sunny_sky.gdshader" id="2_x74tl"] -[ext_resource type="PackedScene" uid="uid://bsnw37bqf5hgr" path="res://src/effects/ballistic_impact.tscn" id="3_g2cjh"] [ext_resource type="Material" uid="uid://dsc0g1qafw80e" path="res://src/maps/arena_map/metal_09.tres" id="3_jqqt6"] [sub_resource type="FastNoiseLite" id="FastNoiseLite_6sfce"] seed = 2 -frequency = 0.071 +frequency = 0.1278 +fractal_type = 3 domain_warp_type = 1 [sub_resource type="NoiseTexture3D" id="NoiseTexture3D_7f12p"] @@ -22,9 +23,9 @@ noise = SubResource("FastNoiseLite_6sfce") shader = ExtResource("2_x74tl") shader_parameter/sun_color = Color(1, 1, 1, 1) shader_parameter/sky_color = Color(0, 0, 0, 1) -shader_parameter/threshold = 0.4 -shader_parameter/speed = 0.008 -shader_parameter/rotation = 2.0 +shader_parameter/threshold = 0.407 +shader_parameter/speed = 0.002 +shader_parameter/rotation = 4.0 shader_parameter/base_noise = SubResource("NoiseTexture3D_7f12p") [sub_resource type="Sky" id="Sky_7lp20"] @@ -123,16 +124,15 @@ _data = { } [node name="ArenaMap" type="Node3D"] +script = ExtResource("1_5ols7") [node name="Player" parent="." instance=ExtResource("1_tgee4")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) +_equipment = 1 [node name="Dummy" parent="." instance=ExtResource("2_stkni")] transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 10) -[node name="BallisticImpact" parent="." instance=ExtResource("3_g2cjh")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.0573, 2.04418, 9.50299) - [node name="Environment" type="Node3D" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="Environment"] diff --git a/src/player/player.gd b/src/player/player.gd index 6e9a420..15ef324 100644 --- a/src/player/player.gd +++ b/src/player/player.gd @@ -1,11 +1,19 @@ extends DamageableBody +enum Equipment { + AUTOCANNON, + RIFLE, +} + const BASE_SPEED: float = 5.0 const BOOST_FORCE: float = 20.0 const JUMP_FORCE: float = 8.0 const INPUT_SENSITIVITY: float = 0.7 const TURN_SENSITIVITY: float = 0.04 +@export var _equipment: Equipment = Equipment.AUTOCANNON + +var _weapon: Weapon = null var _heat: float = 0.0 var _damage: float = 0.0 @@ -17,6 +25,7 @@ var _damage: float = 0.0 @onready var spark_shower: GPUParticles3D = $SparkShower @onready var autocannon: Weapon = %WeaponSlot/Autocannon +@onready var rifle: Weapon = %WeaponSlot/Rifle @onready var _crosshair: Crosshair = get_tree().get_first_node_in_group("CrosshairGroup") @onready var _overlay: OverlayEffects = get_tree().get_first_node_in_group("OverlayEffectsGroup") @@ -35,8 +44,10 @@ var structure: int: return _structure_meter.structure_count # gdlint: enable=class-definitions-order + func _ready() -> void: - get_rid() + set_equipment(_equipment) + func deal_damage(delta: float) -> void: _damage = clamp(_damage + delta, 0.0, 100.0) @@ -52,6 +63,21 @@ func deal_structure(delta: int) -> void: structure += delta +func set_equipment(value: Equipment) -> void: + if _weapon: + _weapon.deactivate() + _weapon.visible = false + _weapon = null + + match value: + Equipment.AUTOCANNON: + _weapon = autocannon + _weapon.visible = true + Equipment.RIFLE: + _weapon = rifle + _weapon.visible = true + + func is_boosting() -> bool: return animation_tree["parameters/boost/active"] @@ -81,9 +107,6 @@ func _physics_process(delta: float) -> void: if Input.is_action_just_pressed("ui_cancel"): shutdown() - - if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT): - autocannon.trigger() # DEBUG BLOCK }}} var effective_gravity: float = GameState.gravity @@ -156,6 +179,12 @@ func _physics_process(delta: float) -> void: velocity.x = lerpf(velocity.x, 0.0, delta_factor * drag) velocity.z = lerpf(velocity.z, 0.0, delta_factor * drag) + if Input.is_action_just_pressed("weapon_trigger"): + _weapon.trigger() + + if Input.is_action_just_released("weapon_trigger"): + _weapon.release() + # Take heat if exposed to the sun: if not shadow_listener.in_shadow(): deal_heat(GameState.SOLAR_HEAT_RATE) diff --git a/src/player/player.tscn b/src/player/player.tscn index 2900e0a..6c561bf 100644 --- a/src/player/player.tscn +++ b/src/player/player.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=11 format=3 uid="uid://bqp5mwyat3asv"] +[gd_scene load_steps=12 format=3 uid="uid://bqp5mwyat3asv"] [ext_resource type="Script" path="res://src/player/player.gd" id="1_h16ke"] [ext_resource type="PackedScene" uid="uid://b0ob0t4rhygcx" path="res://src/effects/spark_shower.tscn" id="2_4nuwf"] [ext_resource type="Script" path="res://src/player/third_person_camera.gd" id="3_gichr"] -[ext_resource type="PackedScene" uid="uid://in6j0ylwrk7l" path="res://src/equip/autocannon.tscn" id="3_viob3"] +[ext_resource type="PackedScene" uid="uid://in6j0ylwrk7l" path="res://src/equip/autocannon/autocannon.tscn" id="3_uu3fg"] +[ext_resource type="PackedScene" uid="uid://csm36ra2445ho" path="res://src/equip/rifle/rifle.tscn" id="4_kuw75"] [ext_resource type="PackedScene" uid="uid://dd7ebaau8a70n" path="res://assets/models/bipedal_mech/mech.tscn" id="4_s7336"] [ext_resource type="PackedScene" uid="uid://bg450j3javgoj" path="res://src/util/shadow_listener.tscn" id="4_vf568"] @@ -55,149 +56,153 @@ script = ExtResource("1_h16ke") transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0, -0.05) [node name="Skeleton3D" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5" index="0"] -bones/1/position = Vector3(0, 0, 6.33372) +bones/1/position = Vector3(0, 0, 6.46884) bones/1/rotation = Quaternion(0.707107, 0, 0, 0.707107) -bones/3/rotation = Quaternion(0.652878, 0.672476, 0.242991, 0.249964) -bones/4/rotation = Quaternion(0.720335, 0.0547061, 0.0744505, 0.687446) -bones/5/rotation = Quaternion(-0.638651, -0.00117237, -0.10387, 0.762453) -bones/6/rotation = Quaternion(-0.432258, 0.0116889, -0.0626312, 0.899497) -bones/7/rotation = Quaternion(-0.846884, 0.0355363, -0.175509, 0.500721) -bones/11/rotation = Quaternion(-0.843428, 0.042092, -0.171042, 0.507545) -bones/17/rotation = Quaternion(0.751496, 0.0181637, 0.659123, 0.021936) -bones/23/rotation = Quaternion(0.885439, 0.00352674, 0.146109, 0.441177) -bones/27/rotation = Quaternion(-0.578571, -0.00535294, -0.106483, 0.808634) -bones/33/rotation = Quaternion(-0.570965, -0.00943927, -0.111499, 0.813313) -bones/35/rotation = Quaternion(-0.658131, 0.00394982, -0.106742, 0.745288) -bones/41/rotation = Quaternion(-0.0149476, 0.93859, 0.3445, 0.012072) +bones/3/rotation = Quaternion(0.655734, 0.67508, 0.235659, 0.242374) +bones/4/rotation = Quaternion(0.697636, 0.0563728, 0.0721019, 0.710583) +bones/5/rotation = Quaternion(-0.619353, -0.00145071, -0.101067, 0.778579) +bones/6/rotation = Quaternion(-0.435901, 0.0113429, -0.0629168, 0.897721) +bones/7/rotation = Quaternion(-0.839861, 0.0366858, -0.173657, 0.512963) +bones/11/rotation = Quaternion(-0.836251, 0.0433197, -0.169112, 0.519817) +bones/17/rotation = Quaternion(0.751705, 0.0105025, 0.659336, 0.0102386) +bones/23/rotation = Quaternion(0.90216, 0.0036072, 0.148829, 0.404899) +bones/27/rotation = Quaternion(-0.550566, -0.00584392, -0.102548, 0.828449) +bones/33/rotation = Quaternion(-0.542666, -0.00997892, -0.107582, 0.832971) +bones/35/rotation = Quaternion(-0.62985, 0.00354465, -0.102463, 0.769921) +bones/41/rotation = Quaternion(-0.0147619, 0.935629, 0.35247, 0.0120527) bones/50/rotation = Quaternion(0.80296, 2.84212e-07, 3.82883e-07, 0.596033) bones/51/rotation = Quaternion(0.595723, -0.000239473, 0.000322365, 0.80319) bones/55/rotation = Quaternion(0.595723, 0.000238707, -0.000321796, 0.80319) bones/62/rotation = Quaternion(-0.000385918, 2.26638e-14, -0.000401128, 1) bones/66/rotation = Quaternion(-0.000385918, -2.26638e-14, 0.000401128, 1) -bones/74/rotation = Quaternion(-0.652876, 0.672473, 0.242997, -0.249971) -bones/75/rotation = Quaternion(0.720335, -0.0547061, -0.0744505, 0.687446) -bones/76/rotation = Quaternion(-0.638651, 0.00117237, 0.10387, 0.762453) -bones/77/rotation = Quaternion(-0.432258, -0.011689, 0.0626311, 0.899497) -bones/78/rotation = Quaternion(-0.846884, -0.0355364, 0.175509, 0.500721) -bones/82/rotation = Quaternion(-0.843428, -0.042092, 0.171042, 0.507545) -bones/88/rotation = Quaternion(0.751496, -0.0181636, -0.659123, 0.0219361) -bones/94/rotation = Quaternion(0.885443, -0.00352645, -0.14611, 0.44117) -bones/98/rotation = Quaternion(-0.578589, 0.00535375, 0.106484, 0.80862) -bones/102/rotation = Quaternion(-0.570946, 0.00943871, 0.111498, 0.813326) -bones/106/rotation = Quaternion(-0.658131, -0.00394973, 0.106742, 0.745288) -bones/112/rotation = Quaternion(0.0149479, 0.938575, 0.344541, -0.0120713) +bones/74/rotation = Quaternion(-0.655734, 0.675079, 0.235659, -0.242374) +bones/75/rotation = Quaternion(0.697636, -0.0563728, -0.0721019, 0.710583) +bones/76/rotation = Quaternion(-0.619353, 0.00145071, 0.101067, 0.778579) +bones/77/rotation = Quaternion(-0.43594, -0.0113404, 0.0629191, 0.897702) +bones/78/rotation = Quaternion(-0.839861, -0.0366859, 0.173657, 0.512963) +bones/82/rotation = Quaternion(-0.836252, -0.0433456, 0.169073, 0.519825) +bones/88/rotation = Quaternion(0.751705, -0.0105025, -0.659336, 0.0102386) +bones/94/rotation = Quaternion(0.902161, -0.00360732, -0.148829, 0.404899) +bones/98/rotation = Quaternion(-0.550566, 0.00584395, 0.102548, 0.828449) +bones/102/rotation = Quaternion(-0.542666, 0.0099789, 0.107583, 0.832971) +bones/106/rotation = Quaternion(-0.62985, -0.00354462, 0.102463, 0.769921) +bones/112/rotation = Quaternion(0.0147619, 0.935629, 0.35247, -0.0120527) bones/122/rotation = Quaternion(0.993232, -0.00676712, 0.0811637, -0.0828125) bones/126/rotation = Quaternion(0.993232, 0.00676712, -0.0811637, -0.0828125) [node name="Plane_009_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="0"] -transform = Transform3D(0.999998, 0.00036028, 0.00174418, -0.000412732, 0.999546, 0.0301726, -0.00173245, -0.0301733, 0.999543, -0.00757074, -0.0232477, 0.0362828) +transform = Transform3D(1, 5.60731e-05, -5.56484e-05, -5.59241e-05, 0.999999, 0.0017142, 5.58719e-05, -0.0017145, 0.999999, -1.62125e-05, -0.00369889, 0.00139481) [node name="Plane_012_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="1"] -transform = Transform3D(0.999998, 0.000643373, 0.00191935, -0.000701502, 0.999537, 0.0304209, -0.0018988, -0.0304223, 0.999536, -0.00799942, -0.0231996, 0.0362565) +transform = Transform3D(1, 9.09418e-05, 1.19358e-05, -9.09716e-05, 0.999998, 0.00173777, -1.16676e-05, -0.00173792, 0.999998, -0.00010705, -0.00365144, 0.00159562) [node name="Cube_016_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="2"] -transform = Transform3D(1, -0.00041829, 0.000630543, 0.00041827, 1, 1.48565e-05, -0.000630498, -1.4618e-05, 1, -0.00586176, -0.00128412, 0.00187916) +transform = Transform3D(1, 9.07108e-06, -7.52807e-05, -9.02824e-06, 1, 8.37296e-05, 7.53701e-05, -8.38339e-05, 1, 4.64916e-05, -0.00249441, -0.000305742) [node name="Plane_004_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="3"] -transform = Transform3D(0.999998, -0.000299484, 0.00129335, 0.000249609, 0.999264, 0.038356, -0.00130382, -0.0383558, 0.999264, -0.00592709, -0.0437889, 0.0108784) +transform = Transform3D(0.999999, 8.00043e-05, -3.24845e-05, -7.98851e-05, 0.999997, 0.00234801, 3.27528e-05, -0.00234828, 0.999997, 2.28882e-05, -0.00480932, 0.0001719) [node name="Cube_013_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="4"] -transform = Transform3D(0.999999, -0.000354029, 0.00148444, 0.000341162, 0.999963, 0.008654, -0.00148738, -0.00865349, 0.999962, -0.00617385, -0.00437653, 0.0028348) +transform = Transform3D(1, 1.66669e-05, -3.04058e-05, -1.65999e-05, 1, 0.000608623, 3.0525e-05, -0.000608712, 1, 3.14713e-05, -0.00267345, -0.000271797) [node name="Plane_011_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="5"] -transform = Transform3D(0.999999, -0.00113299, -0.000314938, 0.00114438, 0.999247, 0.0387953, 0.000270774, -0.0387957, 0.999247, 0.003371, -0.240618, -0.0111723) +transform = Transform3D(1, 4.44204e-05, -8.06106e-06, -4.43608e-05, 0.999999, 0.00132725, 8.24174e-06, -0.00132732, 0.999999, 5.126e-05, -0.00793183, -0.00037241) [node name="Plane_002_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="6"] -transform = Transform3D(0.999998, 0.000597566, 0.00166115, -0.000643104, 0.999621, 0.0275544, -0.00164397, -0.0275555, 0.999619, -0.00815511, -0.012984, 0.05339) +transform = Transform3D(1, 4.00841e-05, -4.49046e-05, -3.99798e-05, 1, 0.00105822, 4.50872e-05, -0.00105837, 0.999999, -1.19209e-05, -0.00294256, 0.000767946) [node name="Plane_013_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="7"] -transform = Transform3D(0.999998, 0.000597566, 0.00166115, -0.000643104, 0.999621, 0.0275544, -0.00164397, -0.0275555, 0.999619, -0.00815511, -0.012984, 0.05339) +transform = Transform3D(1, 4.00841e-05, -4.49046e-05, -3.99798e-05, 1, 0.00105822, 4.50872e-05, -0.00105837, 0.999999, -1.19209e-05, -0.00294256, 0.000767946) [node name="Cube_007_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="8"] -transform = Transform3D(0.999999, -0.000434808, 0.00123639, 0.0003924, 0.999418, 0.0341015, -0.00125042, -0.0341011, 0.999418, -0.00581861, -0.0381809, 0.0100269) +transform = Transform3D(1, -1.34706e-05, -3.68878e-05, 1.35675e-05, 0.999999, 0.00117385, 3.70368e-05, -0.00117391, 0.999999, 4.36306e-05, -0.00354874, -0.000138044) [node name="Plane_015_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="9"] -transform = Transform3D(0.999998, -0.000297926, 0.00204754, 0.000385799, 0.999073, -0.0430476, -0.00203273, 0.0430482, 0.999071, -0.00769114, 0.13084, -0.0439095) +transform = Transform3D(1, 2.95788e-06, 3.70145e-05, -2.88337e-06, 1, -0.000494987, -3.68729e-05, 0.000494868, 1, -0.00013113, 0.000153601, -0.0011425) [node name="Cube_010_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="10"] -transform = Transform3D(1, -2.40505e-05, -0.000493186, 4.42415e-05, 0.999161, 0.0409548, 0.000491828, -0.0409548, 0.999161, 0.0032146, -0.247835, -0.107402) +transform = Transform3D(1, 1.35191e-05, -1.38459e-05, -1.34427e-05, 0.999999, 0.00148619, 1.40115e-05, -0.00148624, 0.999999, 8.15392e-05, -0.00901294, -0.00236797) [node name="Cube_012_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="11"] -transform = Transform3D(1, -0.000202978, -0.000435671, 0.000213118, 0.999727, 0.0233685, 0.000430851, -0.0233686, 0.999727, 0.0029788, -0.1511, -0.11854) +transform = Transform3D(1, 5.23681e-06, -1.50538e-05, -5.16894e-06, 1, 0.000898331, 1.52076e-05, -0.000898391, 1, 9.27448e-05, -0.00577921, -0.00265217) [node name="Cylinder_002_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="12"] -transform = Transform3D(1, -1.77636e-15, 0, -1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.138483) +transform = Transform3D(1, -1.77636e-15, 0, -1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.0033555) [node name="Cube_006_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="13"] -transform = Transform3D(1, 7.18899e-10, -2.01781e-08, -7.60139e-10, 1, -1.49128e-07, 2.01603e-08, 1.78756e-07, 1, -1.19209e-07, -1.43051e-06, -0.138482) +transform = Transform3D(1, 7.18899e-10, -2.01781e-08, -7.60139e-10, 1, -1.49128e-07, 2.01603e-08, 1.78756e-07, 1, -1.19209e-07, -1.43051e-06, -0.00335598) [node name="Cube_017_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="14"] -transform = Transform3D(1, 3.15225e-10, 2.16325e-08, -3.11474e-10, 1, -1.19326e-07, -2.16737e-08, 1.78814e-07, 1, 1.19209e-07, -1.90735e-06, -0.138484) +transform = Transform3D(1, 3.15225e-10, 2.16325e-08, -3.11474e-10, 1, -1.19326e-07, -2.16737e-08, 1.78814e-07, 1, 1.19209e-07, -1.90735e-06, -0.00335789) [node name="Cube_005_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="15"] -transform = Transform3D(1, -1.7053e-13, -3.41061e-13, 2.84217e-13, 1, -9.23872e-07, 3.41061e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.138484) +transform = Transform3D(1, -1.7053e-13, -3.41061e-13, 2.84217e-13, 1, -9.23872e-07, 3.41061e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.00335789) [node name="WeaponSlot" type="Node3D" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D/Cube_005_Material_0" index="1"] unique_name_in_owner = true transform = Transform3D(1, 1.42109e-14, -4.74338e-20, -1.42109e-14, 1, 1.7053e-13, -3.38813e-20, -1.7053e-13, 1, 0, 0, 0) -[node name="Autocannon" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D/Cube_005_Material_0/WeaponSlot" node_paths=PackedStringArray("excluded") instance=ExtResource("3_viob3")] +[node name="Autocannon" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D/Cube_005_Material_0/WeaponSlot" node_paths=PackedStringArray("excluded") instance=ExtResource("3_uu3fg")] transform = Transform3D(1, -7.45389e-20, -2.84217e-14, -2.84217e-14, -4.37115e-08, -1, 1.35525e-20, 1, -4.37115e-08, -1.61931, -4.00469, 7.83282) +visible = false excluded = [NodePath("../../../../../../../../../../../..")] +[node name="Rifle" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D/Cube_005_Material_0/WeaponSlot" instance=ExtResource("4_kuw75")] +transform = Transform3D(1, 6.97955e-19, 1.77636e-13, 0, -4.37112e-08, -1, -1.35525e-20, 1, -4.37112e-08, -2.90254, -1.10442, 10.4782) + [node name="Cube_005_Inside_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="16"] -transform = Transform3D(1, -1.7053e-13, -3.41061e-13, 2.84217e-13, 1, -9.23872e-07, 3.41061e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.138484) +transform = Transform3D(1, -1.7053e-13, -3.41061e-13, 2.84217e-13, 1, -9.23872e-07, 3.41061e-13, 9.23872e-07, 1, -9.09153e-13, 4.52995e-06, -0.00335789) [node name="Plane_003_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="17"] -transform = Transform3D(1, 1.08827e-10, -1.00637e-08, -1.10077e-10, 1, -2.82656e-07, 1.00761e-08, 2.82598e-07, 1, -2.38419e-07, 0, -0.138483) +transform = Transform3D(1, 1.08827e-10, -1.00637e-08, -1.10077e-10, 1, -2.82656e-07, 1.00761e-08, 2.82598e-07, 1, -2.38419e-07, 0, -0.00335503) [node name="Plane_016_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="18"] -transform = Transform3D(1, -1.08827e-10, 1.00637e-08, 1.10077e-10, 1, -2.82656e-07, -1.00761e-08, 2.82598e-07, 1, 2.38419e-07, 0, -0.138483) +transform = Transform3D(1, -1.08827e-10, 1.00637e-08, 1.10077e-10, 1, -2.82656e-07, -1.00761e-08, 2.82598e-07, 1, 2.38419e-07, 0, -0.00335503) [node name="Cube_008_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="19"] -transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.138483) +transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.0033555) [node name="Cube_008_Inside_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="20"] -transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.138483) +transform = Transform3D(1, -2.64698e-23, 9.95068e-31, 2.64698e-23, 1, 0, -9.95068e-31, 0, 1, -1.90621e-29, 0, -0.0033555) [node name="Plane_006_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="21"] -transform = Transform3D(0.999999, -0.00036034, -0.00174379, 0.000412807, 0.999545, 0.0301921, 0.00173204, -0.0301929, 0.999543, 0.00756931, -0.0233655, 0.0363007) +transform = Transform3D(1, -5.96195e-05, 4.78923e-05, 5.95748e-05, 0.999999, 0.00180373, -4.80115e-05, -0.00180367, 0.999998, 1.93119e-05, -0.00372225, 0.00140262) [node name="Plane_008_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="22"] -transform = Transform3D(0.999998, -0.000643566, -0.00191912, 0.000701696, 0.999537, 0.0304395, 0.00189856, -0.0304408, 0.999535, 0.00799823, -0.0233171, 0.0362738) +transform = Transform3D(1, -0.000106215, 7.14287e-05, 0.000106156, 0.999999, 0.00180167, -7.1615e-05, -0.00180164, 0.999999, 4.48227e-05, -0.00362176, 0.00132036) [node name="Cube_004_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="23"] -transform = Transform3D(1, 0.000418223, -0.000630289, -0.000418196, 1, 3.3319e-05, 0.000630274, -3.31104e-05, 1, 0.00585938, -0.00140235, 0.00189638) +transform = Transform3D(1, -1.26604e-05, 6.74278e-05, 1.27126e-05, 1, 0.000171706, -6.74129e-05, -0.000171661, 1, -4.50611e-05, -0.00251715, -0.000298798) [node name="Plane_005_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="24"] -transform = Transform3D(0.999999, 0.000299513, -0.00129236, -0.000249147, 0.999264, 0.0383744, 0.00130253, -0.0383744, 0.999263, 0.00592971, -0.0439069, 0.0108961) +transform = Transform3D(1, -8.01384e-05, 3.3021e-05, 8.07941e-05, 0.999998, 0.00234793, -3.36468e-05, -0.00234816, 0.999997, -1.88351e-05, -0.00480801, 0.000171661) [node name="Cube_003_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="25"] -transform = Transform3D(0.999999, 0.000354201, -0.00148422, -0.000341326, 0.999962, 0.00867248, 0.0014872, -0.00867203, 0.999961, 0.0061717, -0.00449526, 0.0028522) +transform = Transform3D(1, -1.66595e-05, 3.03909e-05, 1.66893e-05, 1, 0.000608712, -3.04133e-05, -0.000608683, 1, -3.24249e-05, -0.00267351, -0.000271559) [node name="Plane_007_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="26"] -transform = Transform3D(1, 0.00113301, 0.000315137, -0.00114442, 0.999247, 0.0387983, -0.000271023, -0.0387987, 0.999247, -0.00337124, -0.240667, -0.0111613) +transform = Transform3D(1, -4.43459e-05, 7.55396e-06, 4.43161e-05, 0.999999, 0.0013275, -7.65827e-06, -0.0013275, 0.999999, -4.76837e-05, -0.00793314, -0.000369549) [node name="Plane_014_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="27"] -transform = Transform3D(0.999999, -0.000595182, -0.00166262, 0.000640884, 0.999618, 0.0276182, 0.0016455, -0.0276193, 0.999617, 0.00815439, -0.0132011, 0.0534806) +transform = Transform3D(1, -4.01884e-05, 4.48003e-05, 4.01586e-05, 1, 0.00105834, -4.48823e-05, -0.00105837, 0.999999, 1.23978e-05, -0.00294268, 0.000769377) [node name="Plane_010_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="28"] -transform = Transform3D(0.999998, -0.00115739, -0.00172729, 0.00120492, 0.999614, 0.0277815, 0.00169444, -0.0277837, 0.999613, 0.00904775, -0.0129452, 0.0525696) +transform = Transform3D(1, -5.86212e-05, -1.05239e-05, 5.8651e-05, 1, 0.00102657, 1.04606e-05, -0.00102672, 1, 0.000152349, -0.00285637, 0.000900269) [node name="Cube_014_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="29"] -transform = Transform3D(0.999999, 0.000435092, -0.00123651, -0.000392623, 0.999418, 0.0341209, 0.00125057, -0.0341204, 0.999417, 0.00581765, -0.0383013, 0.0100462) +transform = Transform3D(1, 1.33887e-05, 3.66718e-05, -1.3411e-05, 0.999999, 0.00117427, -3.67165e-05, -0.00117427, 0.999999, -4.36306e-05, -0.00354892, -0.000137091) [node name="Plane_001_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="30"] -transform = Transform3D(0.999998, 0.000298128, -0.00204715, -0.000385933, 0.999074, -0.0430293, 0.00203239, 0.0430299, 0.999072, 0.00768948, 0.13072, -0.0438948) +transform = Transform3D(1, -2.96533e-06, -3.68729e-05, 2.97278e-06, 1, -0.000495076, 3.68506e-05, 0.000495017, 1, 0.000130892, 0.000153959, -0.00114202) [node name="Cube_015_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="31"] -transform = Transform3D(1, 2.30912e-05, 0.000490966, -4.31463e-05, 0.999164, 0.0408862, -0.000489643, -0.0408861, 0.999164, -0.00320196, -0.24747, -0.107437) +transform = Transform3D(1, -1.37389e-05, 1.36195e-05, 1.37538e-05, 0.999999, 0.00148631, -1.36645e-05, -0.00148624, 0.999999, -8.03471e-05, -0.00901282, -0.0023675) [node name="Cube_001_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="32"] -transform = Transform3D(1, 0.00020322, 0.000435948, -0.00021337, 0.999727, 0.0233878, -0.00043111, -0.0233878, 0.999727, -0.00298142, -0.151224, -0.118522) +transform = Transform3D(1, -5.24613e-06, 1.50724e-05, 5.26717e-06, 1, 0.000898421, -1.51095e-05, -0.000898421, 1, -9.34601e-05, -0.00577897, -0.00265217) [node name="Cylinder_001_Material_0" parent="Mesh/Mech/Sketchfab_model/bed584e06fe94e71a7ac484cee9f0a16_fbx/Object_2/RootNode/Armature/Object_5/Skeleton3D" index="33"] -transform = Transform3D(1, 1.77636e-15, 0, 1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.138483) +transform = Transform3D(1, 1.77636e-15, 0, 1.77636e-15, 1, -4.37113e-08, 0, 4.37113e-08, 1, 0, 0, -0.0033555) [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) diff --git a/src/shaders/plasma_morph.gdshader b/src/shaders/plasma_morph.gdshader new file mode 100644 index 0000000..6166d83 --- /dev/null +++ b/src/shaders/plasma_morph.gdshader @@ -0,0 +1,20 @@ +shader_type spatial; +render_mode unshaded; + +uniform vec4 color_low: source_color = vec4(0.0, 0.0, 0.0, 1.0); +uniform vec4 color_hi: source_color = vec4(1.0, 1.0, 1.0, 1.0); + +uniform float threshold: hint_range(0.0, 1.0) = 0.5; +uniform float speed = 0.5; +uniform float y_scale = 1.0; + +uniform sampler3D noise: repeat_enable; + + +void fragment() { + vec4 noise_color = texture(noise, vec3(UV.x, UV.y * y_scale, TIME * speed)).rgba; + + vec4 color = noise_color.r > threshold ? color_hi : color_low; + ALBEDO.rgb = color.rgb; + ALPHA = color.a; +} \ No newline at end of file diff --git a/src/shaders/spatial_threshold.gdshader b/src/shaders/spatial_threshold.gdshader index c18a385..ad55720 100644 --- a/src/shaders/spatial_threshold.gdshader +++ b/src/shaders/spatial_threshold.gdshader @@ -1,8 +1,8 @@ shader_type spatial; render_mode unshaded; -uniform vec3 color_low: source_color = vec3(0.0, 0.0, 0.0); -uniform vec3 color_hi: source_color = vec3(1.0, 1.0, 1.0); +uniform vec4 color_low: source_color = vec4(0.0, 0.0, 0.0, 1.0); +uniform vec4 color_hi: source_color = vec4(1.0, 1.0, 1.0, 1.0); uniform float threshold: hint_range(0.0, 1.0) = 0.5; uniform float contrast: hint_range(0.0, 1.0) = 1.0; @@ -30,6 +30,7 @@ void fragment() { // adjust contrast & offset Y = clamp((Y - 0.5 + offset) * contrast + 0.5, 0.0, 1.0); - ALBEDO.rgb = Y > threshold ? color_hi : color_low; - ALPHA = screen_color.a; + vec4 color = Y > threshold ? color_hi : color_low; + ALBEDO.rgb = color.rgb; + ALPHA = color.a; } \ No newline at end of file