diff --git a/levels/ghost_ship/ghost_ship_level.tscn b/levels/ghost_ship/ghost_ship_level.tscn index 7f3a132..37ef173 100644 --- a/levels/ghost_ship/ghost_ship_level.tscn +++ b/levels/ghost_ship/ghost_ship_level.tscn @@ -6047,7 +6047,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -12) mesh = ExtResource("6_6giaa") skeleton = NodePath("../..") -[node name="GunkBody" parent="Airlock/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Airlock/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] initial_mask = ExtResource("3_35kna") source_gunk_material = SubResource("ShaderMaterial_sqa4l") @@ -6145,7 +6145,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 1.5, 0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.9, 1, -1.5) mesh = SubResource("CapsuleMesh_lfacn") -[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit"] +[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Airlock/Props/EVASuit/StaticBody3D"] @@ -6155,7 +6155,7 @@ shape = SubResource("CapsuleShape3D_lfacn") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.9, 1, 1.5) mesh = SubResource("CapsuleMesh_lfacn") -[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit2"] +[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit2" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Airlock/Props/EVASuit2/StaticBody3D"] @@ -6165,7 +6165,7 @@ shape = SubResource("CapsuleShape3D_lfacn") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.9, 1, 1.5) mesh = SubResource("CapsuleMesh_lfacn") -[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit3"] +[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit3" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Airlock/Props/EVASuit3/StaticBody3D"] @@ -6175,7 +6175,7 @@ shape = SubResource("CapsuleShape3D_lfacn") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.9, 1, -1.5) mesh = SubResource("CapsuleMesh_lfacn") -[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit4"] +[node name="StaticBody3D" type="StaticBody3D" parent="Airlock/Props/EVASuit4" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Airlock/Props/EVASuit4/StaticBody3D"] @@ -6225,7 +6225,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -22.5) mesh = ExtResource("25_smvh1") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor1/Hallway1" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor1/Hallway1" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_35kna") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor1/Hallway1/Hallway1"] @@ -6273,7 +6273,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, mesh = ExtResource("27_17ivy") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor1/T-Junction1" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor1/T-Junction1" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 192 source_gunk_material = SubResource("ShaderMaterial_4a0u4") @@ -6285,7 +6285,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -7.5, mesh = ExtResource("25_smvh1") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor1/Hallway2" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor1/Hallway2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_okeuk") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor1/Hallway2/GunkBody"] @@ -6326,7 +6326,7 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -19.5, mesh = ExtResource("31_ji5cn") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor1/Hallway3" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor1/Hallway3" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_d8p6j") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor1/Hallway3/GunkBody"] @@ -6350,7 +6350,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -27, 0 mesh = ExtResource("28_ji5cn") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor1/T-Junction2" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor1/T-Junction2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 192 source_gunk_material = SubResource("ShaderMaterial_gim1e") @@ -6374,7 +6374,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -27, 0 mesh = ExtResource("33_okeuk") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor1/Hallway4" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor1/Hallway4" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_otfxe") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor1/Hallway4/GunkBody"] @@ -6415,7 +6415,7 @@ transform = Transform3D(-1, 8.74228e-08, -3.82137e-15, 0, -4.37114e-08, -1, -8.7 mesh = ExtResource("29_35kna") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="MessHall/Walls/Wall" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="MessHall/Walls/Wall" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_lfacn") @@ -6597,7 +6597,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 5) mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="MessHall/Floors/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="MessHall/Floors/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_f0xh4") [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Floors/Floor/GunkBody"] @@ -6608,7 +6608,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9, 0, 5) mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="MessHall/Floors/Floor3" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="MessHall/Floors/Floor3" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_kp5n7") [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Floors/Floor3/GunkBody"] @@ -6642,7 +6642,7 @@ shape = SubResource("ConcavePolygonShape3D_d1yty") transform = Transform3D(0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -2.4, 0.4, 6.2) mesh = SubResource("BoxMesh_4a0u4") -[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Table"] +[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Table" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Props/Table/StaticBody3D"] @@ -6652,7 +6652,7 @@ shape = SubResource("ConcavePolygonShape3D_35kna") transform = Transform3D(0.866025, 0, -0.5, 0, 1, 0, 0.5, 0, 0.866025, -7.5, 0.4, 4.1) mesh = SubResource("BoxMesh_4a0u4") -[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Table2"] +[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Table2" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Props/Table2/StaticBody3D"] @@ -6662,7 +6662,7 @@ shape = SubResource("ConcavePolygonShape3D_4a0u4") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13, 0.5, 3.5) mesh = SubResource("BoxMesh_35kna") -[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Counter"] +[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Counter" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Props/Counter/StaticBody3D"] @@ -6672,7 +6672,7 @@ shape = SubResource("ConcavePolygonShape3D_okeuk") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13, 2.5, 4.5) mesh = SubResource("BoxMesh_okeuk") -[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Cupboard"] +[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Cupboard" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Props/Cupboard/StaticBody3D"] @@ -6682,7 +6682,7 @@ shape = SubResource("ConcavePolygonShape3D_d8p6j") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.8, 1.3, 7.996) mesh = SubResource("BoxMesh_d8p6j") -[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Freezer"] +[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/Freezer" groups=["MetalMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Props/Freezer/StaticBody3D"] @@ -6692,7 +6692,7 @@ shape = SubResource("ConcavePolygonShape3D_otfxe") transform = Transform3D(-0.422618, -0.906308, -3.69465e-08, -0.906308, 0.422618, -7.92319e-08, 8.74228e-08, 0, -1, 0.481997, 1.19006, 4.7) mesh = SubResource("BoxMesh_gim1e") -[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/VendingMachine"] +[node name="StaticBody3D" type="StaticBody3D" parent="MessHall/Props/VendingMachine" groups=["MetalMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="MessHall/Props/VendingMachine/StaticBody3D"] @@ -6896,7 +6896,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, mesh = ExtResource("33_okeuk") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor2/Hallway1" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor2/Hallway1" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_ojd88") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor2/Hallway1/Hallway1"] @@ -6929,7 +6929,7 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 7.5, 0 mesh = ExtResource("25_smvh1") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor2/Hallway2" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor2/Hallway2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_anoak") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor2/Hallway2/Hallway1"] @@ -6962,7 +6962,7 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, mesh = ExtResource("28_ji5cn") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor2/T-Junction1" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor2/T-Junction1" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 192 source_gunk_material = SubResource("ShaderMaterial_h1nog") @@ -7003,7 +7003,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -18, 0, -66) mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="CrewQuarters/CommonArea/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="CrewQuarters/CommonArea/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_mgo71") [node name="CollisionShape3D" type="CollisionShape3D" parent="CrewQuarters/CommonArea/Bounds/Floor/GunkBody"] @@ -7108,7 +7108,7 @@ shape = SubResource("ConcavePolygonShape3D_lfacn") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.6, -1.2) mesh = SubResource("CylinderMesh_48a1a") -[node name="StaticBody3D" type="StaticBody3D" parent="CrewQuarters/CommonArea/Props/CoffeeTable"] +[node name="StaticBody3D" type="StaticBody3D" parent="CrewQuarters/CommonArea/Props/CoffeeTable" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="CrewQuarters/CommonArea/Props/CoffeeTable/StaticBody3D"] @@ -7137,7 +7137,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, -6) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, -1.5) mesh = ExtResource("35_6giaa") -[node name="GunkBody" parent="CrewQuarters/Room1/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="CrewQuarters/Room1/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_u2hqf") [node name="CollisionShape3D" type="CollisionShape3D" parent="CrewQuarters/Room1/Bounds/Floor/GunkBody"] @@ -7285,7 +7285,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 0, -6) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, -1.5) mesh = ExtResource("35_6giaa") -[node name="GunkBody" parent="CrewQuarters/Room2/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="CrewQuarters/Room2/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_2ybo5") [node name="CollisionShape3D" type="CollisionShape3D" parent="CrewQuarters/Room2/Bounds/Floor/GunkBody"] @@ -7429,7 +7429,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 0, 9) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, -1.5) mesh = ExtResource("35_6giaa") -[node name="GunkBody" parent="CrewQuarters/Room3/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="CrewQuarters/Room3/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_lhj8x") [node name="CollisionShape3D" type="CollisionShape3D" parent="CrewQuarters/Room3/Bounds/Floor/GunkBody"] @@ -7573,7 +7573,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 9) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, -1.5) mesh = ExtResource("35_6giaa") -[node name="GunkBody" parent="CrewQuarters/Room4/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="CrewQuarters/Room4/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_f8ygr") [node name="CollisionShape3D" type="CollisionShape3D" parent="CrewQuarters/Room4/Bounds/Floor/GunkBody"] @@ -7722,7 +7722,7 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 4.5, 0 mesh = ExtResource("25_smvh1") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor3/Hallway" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor3/Hallway" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_0adbo") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor3/Hallway/Hallway1"] @@ -7755,7 +7755,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 12, 0, mesh = ExtResource("25_smvh1") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor3/Hallway2" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor3/Hallway2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_08djo") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor3/Hallway2/Hallway1"] @@ -7788,7 +7788,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 12, 0, mesh = ExtResource("28_ji5cn") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor3/T-Junction1" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/T-Junction1" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 192 source_gunk_material = SubResource("ShaderMaterial_yf6ob") @@ -7800,7 +7800,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 12, 0, mesh = ExtResource("25_smvh1") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor3/Hallway3" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor3/Hallway3" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_8rwkc") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor3/Hallway3/Hallway1"] @@ -7819,7 +7819,7 @@ transform = Transform3D(1, 0, -2.13163e-14, 0, 1, 0, 2.13163e-14, 0, 1, 12, 0, 1 mesh = ExtResource("27_17ivy") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor3/T-Junction2" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/T-Junction2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 192 source_gunk_material = SubResource("ShaderMaterial_ogcyf") @@ -7831,7 +7831,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 12, 0, mesh = ExtResource("25_smvh1") skeleton = NodePath("Hallway1") -[node name="Hallway1" parent="Corridor3/Hallway4" instance=ExtResource("2_2egij")] +[node name="Hallway1" parent="Corridor3/Hallway4" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_lnif7") [node name="CollisionShape3D" type="CollisionShape3D" parent="Corridor3/Hallway4/Hallway1"] @@ -7850,7 +7850,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 12, 0, mesh = ExtResource("27_17ivy") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Corridor3/T-Junction3" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/T-Junction3" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 192 source_gunk_material = SubResource("ShaderMaterial_gxf7f") @@ -7864,7 +7864,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 12, 0, mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="Corridor3/ShortHallway/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/ShortHallway/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_ffr5l") @@ -7915,7 +7915,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="Corridor3/ShortHallway2/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/ShortHallway2/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_wnuyc") @@ -7965,7 +7965,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 30) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="Corridor3/ShortHallway3/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/ShortHallway3/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_38po5") @@ -8030,7 +8030,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="Corridor3/ShortHallway4/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/ShortHallway4/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_341fj") @@ -8080,7 +8080,7 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -6, 0, mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="Corridor3/ShortHallway5/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/ShortHallway5/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_2yyyp") @@ -8130,7 +8130,7 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 15, 0, mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="Corridor3/ShortHallway6/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Corridor3/ShortHallway6/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_6ypgw") @@ -8200,7 +8200,7 @@ transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Medbay/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Medbay/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_20tdk") [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Bounds/Floor/GunkBody"] @@ -8211,7 +8211,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9, 0, 3.93402e-07) mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="Medbay/Bounds/Floor2" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="Medbay/Bounds/Floor2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_6s0nd") [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Bounds/Floor2/GunkBody"] @@ -8437,7 +8437,7 @@ shape = SubResource("ConcavePolygonShape3D_p11ap") transform = Transform3D(-1, 0, -1.74846e-07, 0, 1, 0, 8.74228e-08, 0, -2, 0, 1, -0.299999) mesh = SubResource("CylinderMesh_f0xh4") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/OperatingTable"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/OperatingTable" groups=["MetalMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/OperatingTable/StaticBody3D"] @@ -8452,7 +8452,7 @@ transform = Transform3D(0.707107, 0, -0.707107, 0, 1, 0, 0.707107, 0, 0.707107, mesh = SubResource("BoxMesh_1h5r5") skeleton = NodePath("../..") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Desk"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Desk" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Desk/StaticBody3D"] @@ -8466,7 +8466,7 @@ shape = SubResource("ConcavePolygonShape3D_2qkxu") transform = Transform3D(-0.24869, 0, 0.968583, 0, 1, 0, -0.968583, 0, -0.24869, -1.8, 0.6, 0) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cart/StaticBody3D"] @@ -8476,7 +8476,7 @@ shape = SubResource("ConcavePolygonShape3D_wvfch") transform = Transform3D(0.00523592, -0.866025, 0.499973, -0.999945, -4.2222e-08, 0.0104718, -0.00906879, -0.5, -0.865978, -3.3, 0.355217, -0.599998) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart2"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart2" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cart2/StaticBody3D"] @@ -8486,7 +8486,7 @@ shape = SubResource("ConcavePolygonShape3D_wvfch") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.3, 0.6, 3.9) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart3"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart3" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cart3/StaticBody3D"] @@ -8496,7 +8496,7 @@ shape = SubResource("ConcavePolygonShape3D_wvfch") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.4, 0.6, 3.9) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart4"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart4" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cart4/StaticBody3D"] @@ -8506,7 +8506,7 @@ shape = SubResource("ConcavePolygonShape3D_wvfch") transform = Transform3D(0.965926, 0, -0.258819, 0, 1, 0, 0.258819, 0, 0.965926, -1.2, 0.6, 3.9) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart5"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cart5" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cart5/StaticBody3D"] @@ -8516,7 +8516,7 @@ shape = SubResource("ConcavePolygonShape3D_wvfch") transform = Transform3D(0.866025, 0, 0.5, 0, 1, 0, -0.5, 0, 0.866025, 1.2, 0.6, -3.3) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/MonitorCart"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/MonitorCart" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/MonitorCart/StaticBody3D"] @@ -8534,7 +8534,7 @@ mesh = SubResource("PrismMesh_8r2kq") transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 3.9, 0.6, -8.1) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/MonitorCart2"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/MonitorCart2" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/MonitorCart2/StaticBody3D"] @@ -8552,7 +8552,7 @@ mesh = SubResource("PrismMesh_8r2kq") transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 3.9, 0.6, -6.9) mesh = SubResource("BoxMesh_ii88q") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/MonitorCart3"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/MonitorCart3" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/MonitorCart3/StaticBody3D"] @@ -8570,7 +8570,7 @@ mesh = SubResource("PrismMesh_8r2kq") transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 1.5, 0.5, -13) mesh = SubResource("BoxMesh_35kna") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Counter"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Counter" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Counter/StaticBody3D"] @@ -8580,7 +8580,7 @@ shape = SubResource("ConcavePolygonShape3D_okeuk") transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 2.5, 2.5, -13) mesh = SubResource("BoxMesh_okeuk") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cupboard"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cupboard" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cupboard/StaticBody3D"] @@ -8590,7 +8590,7 @@ shape = SubResource("ConcavePolygonShape3D_d8p6j") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0.5, -7.5) mesh = SubResource("BoxMesh_35kna") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Counter2"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Counter2" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Counter2/StaticBody3D"] @@ -8600,7 +8600,7 @@ shape = SubResource("ConcavePolygonShape3D_okeuk") transform = Transform3D(1, 0, 0, 0, 0.965926, -0.258819, 0, 0.258819, 0.965926, -4, 2.02276, -8.6) mesh = SubResource("BoxMesh_okeuk") -[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cupboard2"] +[node name="StaticBody3D" type="StaticBody3D" parent="Medbay/Props/Cupboard2" groups=["PlasticMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Medbay/Props/Cupboard2/StaticBody3D"] @@ -8681,7 +8681,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -3, 0) mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_45wwf") [node name="CollisionShape3D" type="CollisionShape3D" parent="OpsCenter/Bounds/Floor/GunkBody"] @@ -8692,7 +8692,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9, -3, 3.93403e-07) mesh = ExtResource("6_6giaa") skeleton = NodePath("GunkBody") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor2" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor2" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_r5lvr") [node name="CollisionShape3D" type="CollisionShape3D" parent="OpsCenter/Bounds/Floor2/GunkBody"] @@ -9145,7 +9145,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, -1.31134e-07) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor3" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor3" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_p73n1") @@ -9157,7 +9157,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, -3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor4" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor4" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_i0yw4") @@ -9169,7 +9169,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor5" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor5" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_65lip") @@ -9181,7 +9181,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, -3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor6" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor6" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_leujp") @@ -9193,7 +9193,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor7" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor7" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_w6td3") @@ -9205,7 +9205,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9, 0, -3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor8" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor8" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_5v7i8") @@ -9217,7 +9217,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12, 0, -3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor9" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor9" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_pdhq3") @@ -9229,7 +9229,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12, 0, 1.23979e-06) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor10" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor10" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_ypwsq") @@ -9241,7 +9241,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12, 0, 3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor11" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor11" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_kqkqc") @@ -9253,7 +9253,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0, 3) mesh = ExtResource("35_d8p6j") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Floor12" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Floor12" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] mask_dim = 64 source_gunk_material = SubResource("ShaderMaterial_p8nhf") @@ -9388,7 +9388,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5, 0, 2.38419e-07) mesh = SubResource("ArrayMesh_pifep") skeleton = NodePath("../..") -[node name="GunkBody" parent="OpsCenter/Bounds/Ramp/Floor" instance=ExtResource("2_2egij")] +[node name="GunkBody" parent="OpsCenter/Bounds/Ramp/Floor" groups=["MetalMaterial"] instance=ExtResource("2_2egij")] source_gunk_material = SubResource("ShaderMaterial_08dfj") [node name="CollisionShape3D" type="CollisionShape3D" parent="OpsCenter/Bounds/Ramp/Floor/GunkBody"] diff --git a/project.godot b/project.godot index 24c4e14..9156811 100644 --- a/project.godot +++ b/project.godot @@ -72,6 +72,11 @@ audio/buses/override_bus_layout="user://audio_bus_layout.tres" config/accessibility/enable_screen_shake=true config/accessibility/enable_head_bob=true +[global_group] + +MetalMaterial="This surface is made of metal." +PlasticMaterial="This surface is made of plastic." + [input] move_forward={ diff --git a/src/player/footsteps/foot_controller.gd b/src/player/footsteps/foot_controller.gd index c12fa36..6c54bce 100644 --- a/src/player/footsteps/foot_controller.gd +++ b/src/player/footsteps/foot_controller.gd @@ -1,23 +1,16 @@ class_name FootController extends Node3D -enum SurfaceMaterial { - UNKNOWN, - GRUNK, - PLASTIC, - METAL, -} - @onready var metal: AudioStreamPlayer3D = $Metal -func get_player_for_material(surface_material: SurfaceMaterial) -> AudioStreamPlayer3D: +func get_player_for_material(surface_material: SurfaceMaterial.Type) -> AudioStreamPlayer3D: match surface_material: - SurfaceMaterial.GRUNK: + SurfaceMaterial.Type.GRUNK: pass # TODO - SurfaceMaterial.PLASTIC: + SurfaceMaterial.Type.PLASTIC: pass # TODO - SurfaceMaterial.METAL: + SurfaceMaterial.Type.METAL: return metal - SurfaceMaterial.UNKNOWN: + SurfaceMaterial.Type.UNKNOWN: pass return null diff --git a/src/player/footsteps/footstep_controller.gd b/src/player/footsteps/footstep_controller.gd index 41110ce..1bc47d3 100644 --- a/src/player/footsteps/footstep_controller.gd +++ b/src/player/footsteps/footstep_controller.gd @@ -11,6 +11,8 @@ var _on_right_foot := false @onready var left_foot: FootController = %LeftFoot @onready var right_foot: FootController = %RightFoot +@onready var foot_cast: RayCast3D = %FootCast + func play_footstep() -> void: var foot := right_foot if _on_right_foot else left_foot @@ -19,9 +21,20 @@ func play_footstep() -> void: if relative_speed < 0: return - # TODO: detect surface material - var sfx := foot.get_player_for_material(FootController.SurfaceMaterial.METAL) - sfx.volume_db = BASE_VOLUME + relative_speed * VELOCITY_FACTOR - sfx.play() + var sfx := foot.get_player_for_material(get_material_under_foot()) + if sfx: + sfx.volume_db = BASE_VOLUME + relative_speed * VELOCITY_FACTOR + sfx.play() _on_right_foot = not _on_right_foot + + +func get_material_under_foot() -> SurfaceMaterial.Type: + var collider := foot_cast.get_collider() as Node + if collider is GunkBody: + # Special case: check if collision surface is gunked + if (collider as GunkBody).is_point_gunked( + foot_cast.get_collision_point(), foot_cast.get_collision_normal() + ): + return SurfaceMaterial.Type.GRUNK + return SurfaceMaterial.material_for_collider(collider) diff --git a/src/player/player.tscn b/src/player/player.tscn index d97a2d0..dec2e76 100644 --- a/src/player/player.tscn +++ b/src/player/player.tscn @@ -276,3 +276,7 @@ script = ExtResource("9_l271a") stream = SubResource("AudioStreamRandomizer_ylhto") volume_db = -42.0 bus = &"SFX" + +[node name="FootCast" type="RayCast3D" parent="FootstepController"] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0518835, 0) diff --git a/src/props/bulkhead/bulkhead.tscn b/src/props/bulkhead/bulkhead.tscn index e528d30..402adff 100644 --- a/src/props/bulkhead/bulkhead.tscn +++ b/src/props/bulkhead/bulkhead.tscn @@ -319,7 +319,7 @@ script = ExtResource("2_hknvo") [node name="Frame" parent="." index="0"] mesh = SubResource("ArrayMesh_88aga") -[node name="StaticBody3D" type="StaticBody3D" parent="Frame" index="0"] +[node name="StaticBody3D" type="StaticBody3D" parent="Frame" index="0" groups=["MetalMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Frame/StaticBody3D" index="0"] @@ -328,7 +328,7 @@ shape = SubResource("ConcavePolygonShape3D_88qrs") [node name="Door" parent="." index="1"] mesh = SubResource("ArrayMesh_bso71") -[node name="StaticBody3D" type="StaticBody3D" parent="Door" index="0"] +[node name="StaticBody3D" type="StaticBody3D" parent="Door" index="0" groups=["MetalMaterial"]] collision_layer = 5 [node name="CollisionShape3D" type="CollisionShape3D" parent="Door/StaticBody3D" index="0"] @@ -340,7 +340,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.9, 0) stream = ExtResource("5_4jho1") volume_db = -10.0 -[node name="Ramp" type="StaticBody3D" parent="." index="4"] +[node name="Ramp" type="StaticBody3D" parent="." index="4" groups=["MetalMaterial"]] [node name="MeshInstance3D" type="MeshInstance3D" parent="Ramp" index="0"] transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0.1, 0.325) diff --git a/src/props/crate_long/crate_long.tscn b/src/props/crate_long/crate_long.tscn index 7d15be5..c29a5a8 100644 --- a/src/props/crate_long/crate_long.tscn +++ b/src/props/crate_long/crate_long.tscn @@ -101,7 +101,7 @@ data = PackedVector3Array(0.375, -0.15, 0.75, 0.275, -0.25, 0.75, 0.375, 0.15, 0 [node name="CrateLong" type="MeshInstance3D"] mesh = SubResource("ArrayMesh_c6a2t") -[node name="GunkBody" parent="." instance=ExtResource("5_d06p6")] +[node name="GunkBody" parent="." groups=["PlasticMaterial"] instance=ExtResource("5_d06p6")] mask_dim = 32 source_gunk_material = SubResource("ShaderMaterial_sawbt") diff --git a/src/world/gunk_body/gunk_body.gd b/src/world/gunk_body/gunk_body.gd index 01364d0..7c7a2c6 100644 --- a/src/world/gunk_body/gunk_body.gd +++ b/src/world/gunk_body/gunk_body.gd @@ -10,6 +10,7 @@ const FACE_EPSILON := 0.01 const CLEAR_COLOR := Color.BLACK const MASK_COLOR := Color.RED const CLEAR_TOTAL_EPSILON := 1 +const MASK_THRESHOLD := 0.5 @export var mask_dim := 256 @export var mesh_instance: MeshInstance3D @@ -30,6 +31,7 @@ var _prev_clear_total := -1.0 # _clear_total is async computed in separate thread var _mask_tx: Texture2D +var _cached_mask: Image var _thread: Thread var _mutex: Mutex = Mutex.new() var _semaphore: Semaphore = Semaphore.new() @@ -98,10 +100,10 @@ func _async_compute_clear_total() -> void: # Get mask from GPU # TODO: does this need mutex protection? _mutex.lock() - var mask_img := _mask_tx.get_image() + _cached_mask = _mask_tx.get_image() + _cached_mask.convert(Image.FORMAT_R8) _mutex.unlock() - mask_img.convert(Image.FORMAT_R8) - var px_data := mask_img.get_data() + var px_data := _cached_mask.get_data() var px_sum := 0 for px in px_data: px_sum += px @@ -191,6 +193,17 @@ func _get_px(point: Vector3, normal: Vector3) -> Vector2: return _get_uv(point * global_transform, normal * global_basis) * mask_control.size +func is_point_gunked(point: Vector3, normal: Vector3) -> bool: + var px := _get_px(point, normal) + var result := false + # XXX deadlock potential? + _mutex.lock() + result = _cached_mask and _cached_mask.get_pixelv(px).r < MASK_THRESHOLD + _mutex.unlock() + + return result + + ## Paint a dot on the gunk mask. func paint_dot(point: Vector3, normal: Vector3, radius: float, color: Color = MASK_COLOR) -> void: var px := _get_px(point, normal) diff --git a/src/world/surface_material.gd b/src/world/surface_material.gd new file mode 100644 index 0000000..78c3635 --- /dev/null +++ b/src/world/surface_material.gd @@ -0,0 +1,21 @@ +class_name SurfaceMaterial + +enum Type { + UNKNOWN, + GRUNK, + PLASTIC, + METAL, +} + +const METAL_MATERIAL_GROUP := "MetalMaterial" +const PLASTIC_MATERIAL_GROUP := "PlasticMaterial" + + +static func material_for_collider(collider: Node) -> SurfaceMaterial.Type: + if collider is GunkNode: + return Type.GRUNK + if collider.is_in_group(METAL_MATERIAL_GROUP): + return Type.METAL + if collider.is_in_group(PLASTIC_MATERIAL_GROUP): + return Type.PLASTIC + return Type.UNKNOWN diff --git a/src/world/surface_material.gd.uid b/src/world/surface_material.gd.uid new file mode 100644 index 0000000..b0c55c8 --- /dev/null +++ b/src/world/surface_material.gd.uid @@ -0,0 +1 @@ +uid://cpr406vyaxxge diff --git a/vault/TODO.md b/vault/TODO.md index cf1da79..2235e8f 100644 --- a/vault/TODO.md +++ b/vault/TODO.md @@ -54,9 +54,9 @@ - [x] beam noises - [x] spray noises - [ ] switch klaxon - - [ ] switch OK + - [x] switch OK - [ ] switch activation - - [ ] bulkhead opening + - [x] bulkhead opening - [ ] grunk alarm shriek - [ ] grunk relay chitter - [ ] grunk chittering