diff --git a/asset_dev/props/wall_switch/wall_switch.mtl b/asset_dev/props/wall_switch/wall_switch.mtl new file mode 100644 index 0000000..2358e64 --- /dev/null +++ b/asset_dev/props/wall_switch/wall_switch.mtl @@ -0,0 +1,2 @@ +# Blender 4.3.2 MTL File: 'wall_switch2.blend' +# www.blender.org diff --git a/asset_dev/props/wall_switch/wall_switch.obj b/asset_dev/props/wall_switch/wall_switch.obj new file mode 100644 index 0000000..98b7219 --- /dev/null +++ b/asset_dev/props/wall_switch/wall_switch.obj @@ -0,0 +1,188 @@ +# Blender 4.3.2 +# www.blender.org +mtllib wall_switch.mtl +o WallSwitch.2 +v -0.190000 -0.270000 0.100000 +v -0.190000 0.270000 0.100000 +v -0.300000 -0.400000 -0.100000 +v -0.300000 0.400000 -0.100000 +v 0.240000 -0.320000 0.100000 +v 0.240000 0.320000 0.100000 +v 0.300000 -0.400000 -0.100000 +v 0.300000 0.400000 -0.100000 +v 0.050000 -0.270000 0.100000 +v 0.050000 0.270000 0.100000 +v 0.100000 0.320000 0.100000 +v -0.240000 0.320000 0.100000 +v -0.240000 -0.320000 0.100000 +v 0.100000 -0.320000 0.100000 +v 0.050000 0.270000 0.050000 +v -0.190000 0.270000 0.050000 +v -0.190000 -0.270000 0.050000 +v 0.050000 -0.270000 0.050000 +v -0.175000 0.195000 0.075000 +v -0.175000 0.245000 0.075000 +v -0.175000 0.195000 0.025000 +v -0.175000 0.245000 0.025000 +v 0.035000 0.195000 0.075000 +v 0.035000 0.245000 0.075000 +v 0.035000 0.195000 0.025000 +v 0.035000 0.245000 0.025000 +v 0.017500 0.195000 0.025000 +v -0.157500 0.195000 0.025000 +v -0.157500 0.245000 0.025000 +v 0.017500 0.245000 0.025000 +v -0.157500 0.195000 0.075000 +v 0.017500 0.195000 0.075000 +v 0.017500 0.245000 0.075000 +v -0.157500 0.245000 0.075000 +v -0.175000 -0.225000 0.025000 +v -0.175000 -0.250000 0.050000 +v -0.175000 -0.225000 0.075000 +v -0.157500 -0.225000 0.025000 +v 0.035000 -0.225000 0.075000 +v 0.035000 -0.250000 0.050000 +v 0.035000 -0.225000 0.025000 +v 0.017500 -0.250000 0.050000 +v 0.017500 -0.225000 0.075000 +v 0.017500 -0.225000 0.025000 +v -0.157500 -0.225000 0.075000 +v -0.157500 -0.250000 0.050000 +vn -0.9578 -0.0000 0.2873 +vn -0.0000 -0.0000 -1.0000 +vn 0.9578 -0.0000 0.2873 +vn -0.0000 -0.9285 0.3714 +vn -0.0000 0.9285 0.3714 +vn -0.0000 -0.0000 1.0000 +vn 1.0000 -0.0000 -0.0000 +vn -0.0000 1.0000 -0.0000 +vn -0.0000 -1.0000 -0.0000 +vn -1.0000 -0.0000 -0.0000 +vn -0.0000 -0.7071 -0.7071 +vn -0.0000 -0.7071 0.7071 +vt 0.109375 0.109375 +vt 0.109375 0.453125 +vt 0.000000 0.500000 +vt -0.000000 0.078125 +vt 0.078125 1.000000 +vt 0.078125 0.578125 +vt 0.406250 0.578125 +vt 0.406250 1.000000 +vt 0.484375 0.078125 +vt 0.484375 0.500000 +vt 0.375000 0.453125 +vt 0.375000 0.109375 +vt 0.078125 0.000000 +vt 0.406250 0.000000 +vt 0.296875 0.109375 +vt 0.296875 0.453125 +vt 0.968750 0.281250 +vt 0.562500 0.281250 +vt 0.562500 0.250000 +vt 0.968750 0.250000 +vt 0.140625 0.421875 +vt 0.265625 0.421875 +vt 0.140625 0.140625 +vt 0.265625 0.140625 +vt 0.562500 0.031250 +vt 0.968750 0.031250 +vt 0.531250 0.250000 +vt 0.531250 0.031250 +vt 1.000000 0.031250 +vt 1.000000 0.250000 +vt 0.562500 0.000000 +vt 0.968750 0.000000 +vt 0.750000 0.406250 +vt 0.750000 0.343750 +vt 0.812500 0.343750 +vt 0.812500 0.406250 +vt 0.828125 0.406250 +vt 0.828125 0.343750 +vt 0.843750 0.343750 +vt 0.843750 0.406250 +vt 0.906250 0.343750 +vt 0.906250 0.406250 +vt 0.734375 0.406250 +vt 0.734375 0.343750 +vt 0.937500 0.921875 +vt 1.000000 0.921875 +vt 0.968750 0.953125 +vt 0.812500 0.328125 +vt 0.750000 0.328125 +vt 0.843750 0.328125 +vt 0.906250 0.328125 +vt 0.406250 0.718750 +vt 0.671875 0.718750 +vt 0.671875 0.812500 +vt 0.406250 0.812500 +vt 0.812500 0.921875 +vt 0.750000 0.921875 +vt 0.671875 1.000000 +vt 0.406250 0.906250 +vt 0.671875 0.906250 +vt 0.937500 0.343750 +vt 0.937500 0.406250 +vt 0.671875 0.625000 +vt 0.406250 0.625000 +vt 0.906250 0.921875 +vt 0.828125 0.921875 +vt 0.843750 0.921875 +vt 0.734375 0.921875 +vt 0.875000 0.953125 +vt 0.671875 0.921875 +vt 0.703125 0.953125 +vt 0.734375 0.953125 +vt 0.750000 0.953125 +vt 0.750000 1.000000 +vt 0.734375 1.000000 +vt 0.937500 0.953125 +vt 0.906250 0.953125 +vt 0.937500 1.000000 +vt 0.906250 1.000000 +vt 0.781250 0.953125 +vt 0.671875 0.406250 +vt 1.000000 0.406250 +s 0 +f 13/1/1 12/2/1 4/3/1 3/4/1 +f 3/5/2 4/6/2 8/7/2 7/8/2 +f 7/9/3 8/10/3 6/11/3 5/12/3 +f 3/13/4 7/14/4 5/12/4 14/15/4 13/1/4 +f 8/7/5 4/6/5 12/2/5 11/16/5 6/11/5 +f 5/12/6 6/11/6 11/16/6 14/15/6 +f 2/17/7 1/18/7 17/19/7 16/20/7 +f 2/21/6 10/22/6 11/16/6 12/2/6 +f 1/23/6 2/21/6 12/2/6 13/1/6 +f 9/24/6 1/23/6 13/1/6 14/15/6 +f 10/22/6 9/24/6 14/15/6 11/16/6 +f 18/25/6 15/26/6 16/20/6 17/19/6 +f 1/27/8 9/28/8 18/25/8 17/19/8 +f 10/29/9 2/30/9 16/20/9 15/26/9 +f 9/31/10 10/32/10 15/26/10 18/25/10 +f 19/33/10 20/34/10 22/35/10 21/36/10 +f 27/37/2 30/38/2 26/39/2 25/40/2 +f 25/40/7 26/39/7 24/41/7 23/42/7 +f 31/43/6 34/44/6 20/34/6 19/33/6 +f 43/45/10 44/46/10 42/47/10 +f 29/48/8 22/35/8 20/34/8 34/49/8 +f 26/39/8 30/50/8 33/51/8 24/41/8 +f 30/52/8 29/53/8 34/54/8 33/55/8 +f 19/33/10 21/36/10 35/56/10 37/57/10 +f 28/58/9 27/8/9 32/59/9 31/60/9 +f 23/42/6 24/41/6 33/61/6 32/62/6 +f 32/59/6 33/55/6 34/54/6 31/60/6 +f 21/36/2 22/35/2 29/38/2 28/37/2 +f 28/63/2 29/53/2 30/52/2 27/64/2 +f 23/42/6 32/62/6 43/45/6 39/65/6 +f 21/36/2 28/37/2 38/66/2 35/56/2 +f 27/37/2 25/40/2 41/67/2 44/66/2 +f 31/43/6 19/33/6 37/57/6 45/68/6 +f 41/67/7 39/65/7 40/69/7 +f 38/70/7 45/68/7 46/71/7 +f 46/72/11 36/73/11 35/74/11 38/75/11 +f 42/76/12 40/77/12 39/65/12 43/45/12 +f 40/77/11 42/76/11 44/78/11 41/79/11 +f 36/73/12 46/72/12 45/68/12 37/57/12 +f 37/57/10 35/56/10 36/80/10 +f 28/81/7 31/43/7 45/68/7 38/70/7 +f 32/62/10 27/82/10 44/46/10 43/45/10 +f 25/40/7 23/42/7 39/65/7 41/67/7 diff --git a/asset_dev/props/wall_switch/wall_switch.ubpd b/asset_dev/props/wall_switch/wall_switch.ubpd new file mode 100644 index 0000000..09bca68 Binary files /dev/null and b/asset_dev/props/wall_switch/wall_switch.ubpd differ diff --git a/asset_dev/props/wall_switch/wall_switch1.blend b/asset_dev/props/wall_switch/wall_switch1.blend index 05a92d9..b1b6948 100644 Binary files a/asset_dev/props/wall_switch/wall_switch1.blend and b/asset_dev/props/wall_switch/wall_switch1.blend differ diff --git a/asset_dev/props/wall_switch/wall_switch1.blend1 b/asset_dev/props/wall_switch/wall_switch1.blend1 index 46d606d..6c3fdf3 100644 Binary files a/asset_dev/props/wall_switch/wall_switch1.blend1 and b/asset_dev/props/wall_switch/wall_switch1.blend1 differ diff --git a/asset_dev/props/wall_switch/wall_switch2.blend b/asset_dev/props/wall_switch/wall_switch2.blend new file mode 100644 index 0000000..b88fc25 Binary files /dev/null and b/asset_dev/props/wall_switch/wall_switch2.blend differ diff --git a/asset_dev/props/wall_switch/wall_switch2.blend1 b/asset_dev/props/wall_switch/wall_switch2.blend1 new file mode 100644 index 0000000..d1b98ba Binary files /dev/null and b/asset_dev/props/wall_switch/wall_switch2.blend1 differ diff --git a/asset_dev/props/wall_switch/wall_switch_C.png b/asset_dev/props/wall_switch/wall_switch_C.png new file mode 100644 index 0000000..9de5bef --- /dev/null +++ b/asset_dev/props/wall_switch/wall_switch_C.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13cbf99710835c83622449087093703328f41335c4b74206b3e84c86b34acc6e +size 5947 diff --git a/asset_dev/props/wall_switch/wall_switch_M.png b/asset_dev/props/wall_switch/wall_switch_M.png new file mode 100644 index 0000000..4273fa8 --- /dev/null +++ b/asset_dev/props/wall_switch/wall_switch_M.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c71af1bd16af4844ff1a81c082cb9b79ef14f49fb86f933613139cc85fb3d9c +size 247 diff --git a/asset_dev/props/wall_switch/wall_switch_N.png b/asset_dev/props/wall_switch/wall_switch_N.png new file mode 100644 index 0000000..4234779 --- /dev/null +++ b/asset_dev/props/wall_switch/wall_switch_N.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c44ef28287201701014a1fb310b31a3c373cb1af97fba08d37e3e27c6bd8f729 +size 1306 diff --git a/asset_dev/props/wall_switch/wall_switch_R.png b/asset_dev/props/wall_switch/wall_switch_R.png new file mode 100644 index 0000000..8c481e5 --- /dev/null +++ b/asset_dev/props/wall_switch/wall_switch_R.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3229d8f352dcdd3e84f7e240557f7cf2794c12a4ec4785b45e1ad0b290b78646 +size 220 diff --git a/assets/materials/gunk_material.tres b/assets/materials/gunk_material.tres index 34e602d..7b3f1dd 100644 --- a/assets/materials/gunk_material.tres +++ b/assets/materials/gunk_material.tres @@ -27,7 +27,7 @@ render_priority = 0 shader = ExtResource("1_euy6e") shader_parameter/color_1 = Color(0, 0.03, 0.1, 1) shader_parameter/color_2 = Color(0, 0.1, 0.3, 1) -shader_parameter/emission_color = Color(0.25, 0.875, 1, 1) +shader_parameter/emission_color = Color(0.25, 0.88, 1, 1) shader_parameter/pixellation = 128.0 shader_parameter/time_pixellation = 30.0 shader_parameter/roughness = 0.15 diff --git a/assets/props/wall_switch/wall_switch.bin b/assets/props/wall_switch/wall_switch.bin index 6c9518d..f29fd50 100644 Binary files a/assets/props/wall_switch/wall_switch.bin and b/assets/props/wall_switch/wall_switch.bin differ diff --git a/assets/props/wall_switch/wall_switch.gltf b/assets/props/wall_switch/wall_switch.gltf index 8e5035e..5d4729d 100644 --- a/assets/props/wall_switch/wall_switch.gltf +++ b/assets/props/wall_switch/wall_switch.gltf @@ -24,25 +24,25 @@ { "name":"Switch", "rotation":[ - 0, + -2.980232594040899e-08, 1.1920928955078125e-07, 0, 1 ], "scale":[ 0.9999999403953552, - 0.9999999403953552, - 0.9999999403953552 + 0.9999998211860657, + 0.9999998211860657 ], "translation":[ -0.10576892644166946, - 0.22247494757175446, - 0.11068853735923767 + 0.14664649963378906, + 0.07006558775901794 ] }, { "mesh":0, - "name":"Handle", + "name":"WallSwitch.2", "skin":0 }, { @@ -224,25 +224,9 @@ ] } ], - "materials":[ - { - "doubleSided":true, - "name":"WallSwitch", - "pbrMetallicRoughness":{ - "baseColorFactor":[ - 0.800000011920929, - 0.800000011920929, - 0.800000011920929, - 1 - ], - "metallicFactor":0, - "roughnessFactor":0.5 - } - } - ], "meshes":[ { - "name":"Cube.001", + "name":"Cube", "primitives":[ { "attributes":{ @@ -252,8 +236,7 @@ "JOINTS_0":3, "WEIGHTS_0":4 }, - "indices":5, - "material":0 + "indices":5 } ] } @@ -272,47 +255,47 @@ { "bufferView":0, "componentType":5126, - "count":312, + "count":140, "max":[ - 0.3149999976158142, - 0.3999999761581421, - 0.12200002372264862 + 0.30000001192092896, + 0.4000000059604645, + 0.09999999403953552 ], "min":[ - -0.3149999976158142, - -0.3999999761581421, - -0.11000002920627594 + -0.30000001192092896, + -0.4000000059604645, + -0.09999999403953552 ], "type":"VEC3" }, { "bufferView":1, "componentType":5126, - "count":312, + "count":140, "type":"VEC3" }, { "bufferView":2, "componentType":5126, - "count":312, + "count":140, "type":"VEC2" }, { "bufferView":3, "componentType":5121, - "count":312, + "count":140, "type":"VEC4" }, { "bufferView":4, "componentType":5126, - "count":312, + "count":140, "type":"VEC4" }, { "bufferView":5, "componentType":5123, - "count":564, + "count":252, "type":"SCALAR" }, { @@ -433,124 +416,124 @@ "bufferViews":[ { "buffer":0, - "byteLength":3744, + "byteLength":1680, "byteOffset":0, "target":34962 }, { "buffer":0, - "byteLength":3744, - "byteOffset":3744, + "byteLength":1680, + "byteOffset":1680, "target":34962 }, { "buffer":0, - "byteLength":2496, - "byteOffset":7488, + "byteLength":1120, + "byteOffset":3360, "target":34962 }, { "buffer":0, - "byteLength":1248, - "byteOffset":9984, + "byteLength":560, + "byteOffset":4480, "target":34962 }, { "buffer":0, - "byteLength":4992, - "byteOffset":11232, + "byteLength":2240, + "byteOffset":5040, "target":34962 }, { "buffer":0, - "byteLength":1128, - "byteOffset":16224, + "byteLength":504, + "byteOffset":7280, "target":34963 }, { "buffer":0, "byteLength":128, - "byteOffset":17352 + "byteOffset":7784 }, { "buffer":0, "byteLength":8, - "byteOffset":17480 + "byteOffset":7912 }, { "buffer":0, "byteLength":24, - "byteOffset":17488 + "byteOffset":7920 }, { "buffer":0, "byteLength":32, - "byteOffset":17512 + "byteOffset":7944 }, { "buffer":0, "byteLength":24, - "byteOffset":17544 + "byteOffset":7976 }, { "buffer":0, "byteLength":24, - "byteOffset":17568 + "byteOffset":8000 }, { "buffer":0, "byteLength":540, - "byteOffset":17592 + "byteOffset":8024 }, { "buffer":0, "byteLength":2160, - "byteOffset":18132 + "byteOffset":8564 }, { "buffer":0, "byteLength":24, - "byteOffset":20292 + "byteOffset":10724 }, { "buffer":0, "byteLength":4, - "byteOffset":20316 + "byteOffset":10748 }, { "buffer":0, "byteLength":12, - "byteOffset":20320 + "byteOffset":10752 }, { "buffer":0, "byteLength":16, - "byteOffset":20332 + "byteOffset":10764 }, { "buffer":0, "byteLength":12, - "byteOffset":20348 + "byteOffset":10780 }, { "buffer":0, "byteLength":12, - "byteOffset":20360 + "byteOffset":10792 }, { "buffer":0, "byteLength":16, - "byteOffset":20372 + "byteOffset":10804 }, { "buffer":0, "byteLength":12, - "byteOffset":20388 + "byteOffset":10820 } ], "buffers":[ { - "byteLength":20400, + "byteLength":10832, "uri":"wall_switch.bin" } ] diff --git a/assets/props/wall_switch/wall_switch.gltf.import b/assets/props/wall_switch/wall_switch.gltf.import index 284a3a1..3fd2ac4 100644 --- a/assets/props/wall_switch/wall_switch.gltf.import +++ b/assets/props/wall_switch/wall_switch.gltf.import @@ -3,7 +3,7 @@ importer="scene" importer_version=1 type="PackedScene" -uid="uid://b7nqbny1xop8t" +uid="uid://d0yq007888oq5" path="res://.godot/imported/wall_switch.gltf-66cf36f473896d0320315d5127bdf889.scn" [deps] diff --git a/assets/props/wall_switch/wall_switch_C.png b/assets/props/wall_switch/wall_switch_C.png new file mode 100644 index 0000000..9de5bef --- /dev/null +++ b/assets/props/wall_switch/wall_switch_C.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13cbf99710835c83622449087093703328f41335c4b74206b3e84c86b34acc6e +size 5947 diff --git a/assets/props/wall_switch/wall_switch_C.png.import b/assets/props/wall_switch/wall_switch_C.png.import new file mode 100644 index 0000000..59804da --- /dev/null +++ b/assets/props/wall_switch/wall_switch_C.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://1wjcyqynwlb6" +path="res://.godot/imported/wall_switch_C.png-1aac2c3e3e66ff48b393a731a3060d88.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/props/wall_switch/wall_switch_C.png" +dest_files=["res://.godot/imported/wall_switch_C.png-1aac2c3e3e66ff48b393a731a3060d88.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/props/wall_switch/wall_switch_M.png b/assets/props/wall_switch/wall_switch_M.png new file mode 100644 index 0000000..4273fa8 --- /dev/null +++ b/assets/props/wall_switch/wall_switch_M.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c71af1bd16af4844ff1a81c082cb9b79ef14f49fb86f933613139cc85fb3d9c +size 247 diff --git a/assets/props/wall_switch/wall_switch_M.png.import b/assets/props/wall_switch/wall_switch_M.png.import new file mode 100644 index 0000000..09f0f27 --- /dev/null +++ b/assets/props/wall_switch/wall_switch_M.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bur4dtt4irwgd" +path="res://.godot/imported/wall_switch_M.png-9192c905baea18e55c3a8b99e5303230.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/props/wall_switch/wall_switch_M.png" +dest_files=["res://.godot/imported/wall_switch_M.png-9192c905baea18e55c3a8b99e5303230.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/props/wall_switch/wall_switch_N.png b/assets/props/wall_switch/wall_switch_N.png new file mode 100644 index 0000000..4234779 --- /dev/null +++ b/assets/props/wall_switch/wall_switch_N.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c44ef28287201701014a1fb310b31a3c373cb1af97fba08d37e3e27c6bd8f729 +size 1306 diff --git a/assets/props/wall_switch/wall_switch_N.png.import b/assets/props/wall_switch/wall_switch_N.png.import new file mode 100644 index 0000000..f857034 --- /dev/null +++ b/assets/props/wall_switch/wall_switch_N.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddve6jcfcuthx" +path="res://.godot/imported/wall_switch_N.png-ed33428ca1cb455566c9f4e1ba885254.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/props/wall_switch/wall_switch_N.png" +dest_files=["res://.godot/imported/wall_switch_N.png-ed33428ca1cb455566c9f4e1ba885254.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=1 +roughness/src_normal="res://assets/props/wall_switch/wall_switch_N.png" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/props/wall_switch/wall_switch_R.png b/assets/props/wall_switch/wall_switch_R.png new file mode 100644 index 0000000..8c481e5 --- /dev/null +++ b/assets/props/wall_switch/wall_switch_R.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3229d8f352dcdd3e84f7e240557f7cf2794c12a4ec4785b45e1ad0b290b78646 +size 220 diff --git a/assets/props/wall_switch/wall_switch_R.png.import b/assets/props/wall_switch/wall_switch_R.png.import new file mode 100644 index 0000000..312b78b --- /dev/null +++ b/assets/props/wall_switch/wall_switch_R.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://rq5e0a3sco88" +path="res://.godot/imported/wall_switch_R.png-af958cc33d7624f7ffe7066d18ee57f9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/props/wall_switch/wall_switch_R.png" +dest_files=["res://.godot/imported/wall_switch_R.png-af958cc33d7624f7ffe7066d18ee57f9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/levels/sandbox/sandbox.tscn b/levels/sandbox/sandbox.tscn index 1ed9369..2d86f31 100644 --- a/levels/sandbox/sandbox.tscn +++ b/levels/sandbox/sandbox.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=28 format=3 uid="uid://16ds4fvv72xk"] +[gd_scene load_steps=29 format=3 uid="uid://16ds4fvv72xk"] [ext_resource type="PackedScene" uid="uid://c2omlx4ptrc01" path="res://src/world/gunk_body/gunk_body.tscn" id="1_a67lu"] [ext_resource type="PackedScene" uid="uid://bwe2jdmvinhqd" path="res://src/player/player.tscn" id="1_h436a"] @@ -9,6 +9,7 @@ [ext_resource type="ArrayMesh" uid="uid://bwgiytiic3t32" path="res://assets/props/cube/cube.obj" id="6_4kku3"] [ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_l64ek"] [ext_resource type="ArrayMesh" uid="uid://dchtriuljuloj" path="res://assets/props/cylinder/cylinder.obj" id="7_gn6k6"] +[ext_resource type="PackedScene" uid="uid://b6eg8t04rkh0c" path="res://src/props/wall_switch/wall_switch.tscn" id="9_p27ol"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_cj8bk"] @@ -152,8 +153,9 @@ skeleton = NodePath("../..") [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Floor"] shape = SubResource("WorldBoundaryShape3D_c8g65") -[node name="Icosahedron" parent="Geometry" instance=ExtResource("1_a67lu")] +[node name="Icosahedron" parent="Geometry" node_paths=PackedStringArray("mesh_instance") instance=ExtResource("1_a67lu")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.35498, 1.13294, -2.81423) +mesh_instance = NodePath("MeshInstance3D") [node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Icosahedron"] mesh = ExtResource("1_kvwui") @@ -163,8 +165,9 @@ surface_material_override/0 = ExtResource("3_o7v4k") [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Icosahedron"] shape = SubResource("ConcavePolygonShape3D_nxc47") -[node name="Monkey" parent="Geometry" instance=ExtResource("1_a67lu")] +[node name="Monkey" parent="Geometry" node_paths=PackedStringArray("mesh_instance") instance=ExtResource("1_a67lu")] transform = Transform3D(-0.616239, 0, 0.787559, 0, 1, 0, -0.787559, 0, -0.616239, -2.22512, 1.41158, 2.88581) +mesh_instance = NodePath("MeshInstance3D") [node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Monkey"] mesh = ExtResource("4_o55bf") @@ -174,9 +177,10 @@ surface_material_override/0 = SubResource("StandardMaterial3D_inlin") [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Monkey"] shape = SubResource("ConcavePolygonShape3D_hvf6a") -[node name="Cube" parent="Geometry" instance=ExtResource("1_a67lu")] +[node name="Cube" parent="Geometry" node_paths=PackedStringArray("mesh_instance") instance=ExtResource("1_a67lu")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8, 4, 0) mask_dim = 1024 +mesh_instance = NodePath("MeshInstance3D") [node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Cube"] mesh = ExtResource("6_4kku3") @@ -185,9 +189,10 @@ surface_material_override/0 = SubResource("StandardMaterial3D_chcw1") [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Cube"] shape = SubResource("ConcavePolygonShape3D_0qjrr") -[node name="Cylinder" parent="Geometry" instance=ExtResource("1_a67lu")] +[node name="Cylinder" parent="Geometry" node_paths=PackedStringArray("mesh_instance") instance=ExtResource("1_a67lu")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.33738, 6, -7.18125) mask_dim = 1024 +mesh_instance = NodePath("MeshInstance3D") [node name="MeshInstance3D" type="MeshInstance3D" parent="Geometry/Cylinder"] mesh = ExtResource("7_gn6k6") @@ -197,4 +202,7 @@ surface_material_override/0 = SubResource("StandardMaterial3D_wjqpf") [node name="CollisionShape3D" type="CollisionShape3D" parent="Geometry/Cylinder"] shape = SubResource("ConcavePolygonShape3D_6ood3") +[node name="WallSwitch" parent="Geometry" instance=ExtResource("9_p27ol")] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 3.9, 1.50699, 2.45659) + [node name="Player" parent="." instance=ExtResource("1_h436a")] diff --git a/project.godot b/project.godot index ccd73cc..eaa5a6d 100644 --- a/project.godot +++ b/project.godot @@ -98,8 +98,15 @@ fire={ "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) ] } +interact={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null) +] +} [layer_names] 3d_render/layer_1="World" 3d_render/layer_2="HUD" +3d_physics/layer_1="Physics" +3d_physics/layer_2="Interactive" diff --git a/src/player/player.gd b/src/player/player.gd index d8c81ae..4274331 100644 --- a/src/player/player.gd +++ b/src/player/player.gd @@ -12,8 +12,13 @@ var gravity: Vector3 = ( * ProjectSettings.get_setting("physics/3d/default_gravity_vector") ) +var selected_interactive: Interactive + +@onready var player_hud: PlayerHUD = %PlayerHUD + @onready var camera_pivot: Node3D = %CameraPivot @onready var spray_muzzle: Marker3D = %SprayMuzzle +@onready var interact_ray: RayCast3D = %InteractRay func get_speed() -> float: @@ -35,6 +40,8 @@ func get_spray() -> Spray: func _physics_process(delta: float) -> void: + player_hud.select_interactive(interact_ray.get_collider() as Interactive) + if Input.is_action_pressed("fire"): get_spray().fire() else: diff --git a/src/player/player.tscn b/src/player/player.tscn index 1153673..7aec2d0 100644 --- a/src/player/player.tscn +++ b/src/player/player.tscn @@ -1,8 +1,10 @@ -[gd_scene load_steps=6 format=3 uid="uid://bwe2jdmvinhqd"] +[gd_scene load_steps=8 format=3 uid="uid://bwe2jdmvinhqd"] [ext_resource type="Script" path="res://src/player/player.gd" id="1_npueo"] [ext_resource type="Script" path="res://src/player/camera_controller.gd" id="2_veeqv"] +[ext_resource type="PackedScene" uid="uid://cc102xko0u6yj" path="res://src/equipment/point_spray/point_spray.tscn" id="3_6wgkm"] [ext_resource type="PackedScene" uid="uid://d2hnxr5l6w2x4" path="res://src/equipment/wide_spray/wide_spray.tscn" id="3_ibq07"] +[ext_resource type="PackedScene" uid="uid://dq1x21tq06dud" path="res://src/ui/hud/player_hud.tscn" id="5_jvafu"] [sub_resource type="BoxMesh" id="BoxMesh_ua7a2"] size = Vector3(0.05, 0.05, 0.3) @@ -28,9 +30,21 @@ unique_name_in_owner = true transform = Transform3D(1, 0, 0, 0, 0.997564, -0.0697565, 0, 0.0697565, 0.997564, 0, 0, -0.15) [node name="WideSpray" parent="CameraPivot/SprayNozzle/SprayMuzzle" instance=ExtResource("3_ibq07")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0) + +[node name="PointSpray" parent="CameraPivot/SprayNozzle/SprayMuzzle" instance=ExtResource("3_6wgkm")] +visible = false [node name="Camera3D" type="Camera3D" parent="CameraPivot"] current = true +[node name="InteractRay" type="RayCast3D" parent="CameraPivot/Camera3D"] +unique_name_in_owner = true +target_position = Vector3(0, 0, -1.5) +collision_mask = 2 + [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("CapsuleShape3D_s7f0r") + +[node name="PlayerHUD" parent="." instance=ExtResource("5_jvafu")] +unique_name_in_owner = true diff --git a/src/props/interactive.gd b/src/props/interactive.gd new file mode 100644 index 0000000..b8c55e7 --- /dev/null +++ b/src/props/interactive.gd @@ -0,0 +1,6 @@ +class_name Interactive extends StaticBody3D +## Props the player can interact with. + +signal activate + +@export var disabled := false diff --git a/src/props/wall_switch/wall_switch.gd b/src/props/wall_switch/wall_switch.gd new file mode 100644 index 0000000..67e954f --- /dev/null +++ b/src/props/wall_switch/wall_switch.gd @@ -0,0 +1 @@ +extends Node3D diff --git a/src/props/wall_switch/wall_switch.tscn b/src/props/wall_switch/wall_switch.tscn new file mode 100644 index 0000000..828046f --- /dev/null +++ b/src/props/wall_switch/wall_switch.tscn @@ -0,0 +1,194 @@ +[gd_scene load_steps=26 format=3 uid="uid://b6eg8t04rkh0c"] + +[ext_resource type="Script" path="res://src/props/wall_switch/wall_switch.gd" id="2_kfvqd"] +[ext_resource type="Texture2D" uid="uid://1wjcyqynwlb6" path="res://assets/props/wall_switch/wall_switch_C.png" id="2_vufqs"] +[ext_resource type="PackedScene" uid="uid://d0yq007888oq5" path="res://assets/props/wall_switch/wall_switch.gltf" id="2_whafo"] +[ext_resource type="Texture2D" uid="uid://bur4dtt4irwgd" path="res://assets/props/wall_switch/wall_switch_M.png" id="3_3fhmv"] +[ext_resource type="Shader" path="res://src/shaders/gunk.gdshader" id="4_km3i7"] +[ext_resource type="Texture2D" uid="uid://ddve6jcfcuthx" path="res://assets/props/wall_switch/wall_switch_N.png" id="4_pg3hp"] +[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="5_382wj"] +[ext_resource type="Texture2D" uid="uid://rq5e0a3sco88" path="res://assets/props/wall_switch/wall_switch_R.png" id="5_555wb"] +[ext_resource type="PackedScene" uid="uid://c2omlx4ptrc01" path="res://src/world/gunk_body/gunk_body.tscn" id="7_3ib1l"] +[ext_resource type="Script" path="res://src/props/interactive.gd" id="10_qw6jt"] + +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_ow0bp"] +load_path = "res://.godot/imported/debug_mask.png-fd2bc783338ed9439fe81a4eef9d86da.s3tc.ctex" + +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_d70or"] +width = 256 +height = 256 +depth = 32 +seamless = true +seamless_blend_skirt = 0.5 +noise = ExtResource("5_382wj") + +[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_0ksu8"] +width = 256 +height = 256 +depth = 32 +seamless = true +seamless_blend_skirt = 0.5 +noise = ExtResource("5_382wj") + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_wtn7s"] +render_priority = 0 +shader = ExtResource("4_km3i7") +shader_parameter/color_1 = Color(0, 0.03, 0.1, 1) +shader_parameter/color_2 = Color(0, 0.1, 0.3, 1) +shader_parameter/emission_color = Color(0.25, 0.88, 1, 1) +shader_parameter/pixellation = 32.0 +shader_parameter/time_pixellation = 30.0 +shader_parameter/roughness = 0.15 +shader_parameter/specular_contribution = 0.8 +shader_parameter/emission_strength = 0.02 +shader_parameter/uv_scale = Vector2(2, 2) +shader_parameter/time_scale = 0.2 +shader_parameter/edge_bleed = 0.25 +shader_parameter/gunk_mask = SubResource("CompressedTexture2D_ow0bp") +shader_parameter/gunk_noise = SubResource("NoiseTexture3D_d70or") +shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_0ksu8") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_o1wte"] +next_pass = SubResource("ShaderMaterial_wtn7s") +albedo_texture = ExtResource("2_vufqs") +metallic = 1.0 +metallic_texture = ExtResource("3_3fhmv") +roughness_texture = ExtResource("5_555wb") +normal_enabled = true +normal_texture = ExtResource("4_pg3hp") +texture_filter = 2 + +[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_1xqlp"] +data = PackedVector3Array(-0.24, -0.32, 0.1, -0.3, 0.4, -0.1, -0.24, 0.32, 0.1, -0.24, -0.32, 0.1, -0.3, -0.4, -0.1, -0.3, 0.4, -0.1, -0.3, -0.4, -0.1, 0.3, 0.4, -0.1, -0.3, 0.4, -0.1, -0.3, -0.4, -0.1, 0.3, -0.4, -0.1, 0.3, 0.4, -0.1, 0.3, -0.4, -0.1, 0.24, 0.32, 0.1, 0.3, 0.4, -0.1, 0.3, -0.4, -0.1, 0.24, -0.32, 0.1, 0.24, 0.32, 0.1, -0.24, -0.32, 0.1, 0.3, -0.4, -0.1, -0.3, -0.4, -0.1, 0.3, -0.4, -0.1, 0.1, -0.32, 0.1, 0.24, -0.32, 0.1, 0.3, -0.4, -0.1, -0.24, -0.32, 0.1, 0.1, -0.32, 0.1, 0.24, 0.32, 0.1, -0.3, 0.4, -0.1, 0.3, 0.4, -0.1, -0.3, 0.4, -0.1, 0.1, 0.32, 0.1, -0.24, 0.32, 0.1, -0.3, 0.4, -0.1, 0.24, 0.32, 0.1, 0.1, 0.32, 0.1, 0.24, -0.32, 0.1, 0.1, 0.32, 0.1, 0.24, 0.32, 0.1, 0.24, -0.32, 0.1, 0.1, -0.32, 0.1, 0.1, 0.32, 0.1, -0.19, 0.27, 0.1, -0.19, -0.27, 0.05, -0.19, -0.27, 0.1, -0.19, 0.27, 0.1, -0.19, 0.27, 0.05, -0.19, -0.27, 0.05, -0.19, 0.27, 0.1, 0.1, 0.32, 0.1, 0.05, 0.27, 0.1, -0.19, 0.27, 0.1, -0.24, 0.32, 0.1, 0.1, 0.32, 0.1, -0.19, -0.27, 0.1, -0.24, 0.32, 0.1, -0.19, 0.27, 0.1, -0.19, -0.27, 0.1, -0.24, -0.32, 0.1, -0.24, 0.32, 0.1, 0.05, -0.27, 0.1, -0.24, -0.32, 0.1, -0.19, -0.27, 0.1, 0.05, -0.27, 0.1, 0.1, -0.32, 0.1, -0.24, -0.32, 0.1, 0.05, 0.27, 0.1, 0.1, -0.32, 0.1, 0.05, -0.27, 0.1, 0.05, 0.27, 0.1, 0.1, 0.32, 0.1, 0.1, -0.32, 0.1, 0.05, -0.27, 0.05, -0.19, 0.27, 0.05, 0.05, 0.27, 0.05, 0.05, -0.27, 0.05, -0.19, -0.27, 0.05, -0.19, 0.27, 0.05, -0.19, -0.27, 0.1, 0.05, -0.27, 0.05, 0.05, -0.27, 0.1, -0.19, -0.27, 0.1, -0.19, -0.27, 0.05, 0.05, -0.27, 0.05, 0.05, 0.27, 0.1, -0.19, 0.27, 0.05, -0.19, 0.27, 0.1, 0.05, 0.27, 0.1, 0.05, 0.27, 0.05, -0.19, 0.27, 0.05, 0.05, -0.27, 0.1, 0.05, 0.27, 0.05, 0.05, 0.27, 0.1, 0.05, -0.27, 0.1, 0.05, -0.27, 0.05, 0.05, 0.27, 0.05, -0.175, 0.195, 0.075, -0.175, 0.245, 0.025, -0.175, 0.245, 0.075, -0.175, 0.195, 0.075, -0.175, 0.195, 0.025, -0.175, 0.245, 0.025, 0.0175, 0.195, 0.025, 0.035, 0.245, 0.025, 0.0175, 0.245, 0.025, 0.0175, 0.195, 0.025, 0.035, 0.195, 0.025, 0.035, 0.245, 0.025, 0.035, 0.195, 0.025, 0.035, 0.245, 0.075, 0.035, 0.245, 0.025, 0.035, 0.195, 0.025, 0.035, 0.195, 0.075, 0.035, 0.245, 0.075, -0.1575, 0.195, 0.075, -0.175, 0.245, 0.075, -0.1575, 0.245, 0.075, -0.1575, 0.195, 0.075, -0.175, 0.195, 0.075, -0.175, 0.245, 0.075, 0.0175, -0.225, 0.075, 0.0175, -0.25, 0.05, 0.0175, -0.225, 0.025, -0.1575, 0.245, 0.025, -0.175, 0.245, 0.075, -0.175, 0.245, 0.025, -0.1575, 0.245, 0.025, -0.1575, 0.245, 0.075, -0.175, 0.245, 0.075, 0.035, 0.245, 0.025, 0.0175, 0.245, 0.075, 0.0175, 0.245, 0.025, 0.035, 0.245, 0.025, 0.035, 0.245, 0.075, 0.0175, 0.245, 0.075, 0.0175, 0.245, 0.025, -0.1575, 0.245, 0.075, -0.1575, 0.245, 0.025, 0.0175, 0.245, 0.025, 0.0175, 0.245, 0.075, -0.1575, 0.245, 0.075, -0.175, 0.195, 0.075, -0.175, -0.225, 0.025, -0.175, 0.195, 0.025, -0.175, 0.195, 0.075, -0.175, -0.225, 0.075, -0.175, -0.225, 0.025, -0.1575, 0.195, 0.025, 0.0175, 0.195, 0.075, 0.0175, 0.195, 0.025, -0.1575, 0.195, 0.025, -0.1575, 0.195, 0.075, 0.0175, 0.195, 0.075, 0.035, 0.195, 0.075, 0.0175, 0.245, 0.075, 0.035, 0.245, 0.075, 0.035, 0.195, 0.075, 0.0175, 0.195, 0.075, 0.0175, 0.245, 0.075, 0.0175, 0.195, 0.075, -0.1575, 0.245, 0.075, 0.0175, 0.245, 0.075, 0.0175, 0.195, 0.075, -0.1575, 0.195, 0.075, -0.1575, 0.245, 0.075, -0.175, 0.195, 0.025, -0.1575, 0.245, 0.025, -0.175, 0.245, 0.025, -0.175, 0.195, 0.025, -0.1575, 0.195, 0.025, -0.1575, 0.245, 0.025, -0.1575, 0.195, 0.025, 0.0175, 0.245, 0.025, -0.1575, 0.245, 0.025, -0.1575, 0.195, 0.025, 0.0175, 0.195, 0.025, 0.0175, 0.245, 0.025, 0.035, 0.195, 0.075, 0.0175, -0.225, 0.075, 0.0175, 0.195, 0.075, 0.035, 0.195, 0.075, 0.035, -0.225, 0.075, 0.0175, -0.225, 0.075, -0.175, 0.195, 0.025, -0.1575, -0.225, 0.025, -0.1575, 0.195, 0.025, -0.175, 0.195, 0.025, -0.175, -0.225, 0.025, -0.1575, -0.225, 0.025, 0.0175, 0.195, 0.025, 0.035, -0.225, 0.025, 0.035, 0.195, 0.025, 0.0175, 0.195, 0.025, 0.0175, -0.225, 0.025, 0.035, -0.225, 0.025, -0.1575, 0.195, 0.075, -0.175, -0.225, 0.075, -0.175, 0.195, 0.075, -0.1575, 0.195, 0.075, -0.1575, -0.225, 0.075, -0.175, -0.225, 0.075, 0.035, -0.225, 0.025, 0.035, -0.25, 0.05, 0.035, -0.225, 0.075, -0.1575, -0.225, 0.025, -0.1575, -0.25, 0.05, -0.1575, -0.225, 0.075, -0.1575, -0.25, 0.05, -0.175, -0.225, 0.025, -0.175, -0.25, 0.05, -0.1575, -0.25, 0.05, -0.1575, -0.225, 0.025, -0.175, -0.225, 0.025, 0.0175, -0.25, 0.05, 0.035, -0.225, 0.075, 0.035, -0.25, 0.05, 0.0175, -0.25, 0.05, 0.0175, -0.225, 0.075, 0.035, -0.225, 0.075, 0.035, -0.25, 0.05, 0.0175, -0.225, 0.025, 0.0175, -0.25, 0.05, 0.035, -0.25, 0.05, 0.035, -0.225, 0.025, 0.0175, -0.225, 0.025, -0.175, -0.25, 0.05, -0.1575, -0.225, 0.075, -0.1575, -0.25, 0.05, -0.175, -0.25, 0.05, -0.175, -0.225, 0.075, -0.1575, -0.225, 0.075, -0.175, -0.225, 0.075, -0.175, -0.25, 0.05, -0.175, -0.225, 0.025, -0.1575, 0.195, 0.025, -0.1575, -0.225, 0.075, -0.1575, 0.195, 0.075, -0.1575, 0.195, 0.025, -0.1575, -0.225, 0.025, -0.1575, -0.225, 0.075, 0.0175, 0.195, 0.075, 0.0175, -0.225, 0.025, 0.0175, 0.195, 0.025, 0.0175, 0.195, 0.075, 0.0175, -0.225, 0.075, 0.0175, -0.225, 0.025, 0.035, 0.195, 0.025, 0.035, -0.225, 0.075, 0.035, 0.195, 0.075, 0.035, 0.195, 0.025, 0.035, -0.225, 0.025, 0.035, -0.225, 0.075) + +[sub_resource type="Animation" id="Animation_pea1n"] +resource_name = "error_blink" +length = 4.0 +loop_mode = 1 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("LightAnimation/DangerLight:mesh:material:emission_energy_multiplier") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1, 3, 4), +"transitions": PackedFloat32Array(0.618, 1, 1.618, 1), +"update": 0, +"values": [0.0, 4.0, 4.0, 0.0] +} + +[sub_resource type="Animation" id="Animation_ugm6b"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("LightAnimation/DangerLight:mesh:material:emission_energy_multiplier") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("LightAnimation/SuccessLight:mesh:material:emission_energy_multiplier") +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="Animation" id="Animation_njbf4"] +resource_name = "success" +length = 0.5 +step = 0.05 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("LightAnimation/SuccessLight:mesh:material:emission_energy_multiplier") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0.0, 4.0, 0.0, 4.0, 0.0, 4.0, 0.0, 4.0, 0.0, 4.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_6ueib"] +_data = { +"RESET": SubResource("Animation_ugm6b"), +"error_blink": SubResource("Animation_pea1n"), +"success": SubResource("Animation_njbf4") +} + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_21svm"] +albedo_color = Color(0, 0, 0, 1) +emission_enabled = true +emission = Color(0.866667, 0.109804, 0.101961, 1) +emission_energy_multiplier = 0.0 + +[sub_resource type="BoxMesh" id="BoxMesh_g24yf"] +material = SubResource("StandardMaterial3D_21svm") +size = Vector3(0.08, 0.05, 0.025) + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0cc87"] +albedo_color = Color(0, 0, 0, 1) +emission_enabled = true +emission = Color(0.137255, 0.984314, 0.34902, 1) +emission_energy_multiplier = 0.0 + +[sub_resource type="BoxMesh" id="BoxMesh_a6hjm"] +material = SubResource("StandardMaterial3D_0cc87") +size = Vector3(0.08, 0.05, 0.025) + +[sub_resource type="BoxShape3D" id="BoxShape3D_6maql"] +size = Vector3(0.475, 0.65, 0.2) + +[node name="WallSwitch" instance=ExtResource("2_whafo")] +script = ExtResource("2_kfvqd") + +[node name="Skeleton3D" parent="Armature" index="0"] +bones/1/rotation = Quaternion(-2.98023e-08, 1.19209e-07, -2.11758e-22, 1) + +[node name="WallSwitch_2" parent="Armature/Skeleton3D" index="0"] +surface_material_override/0 = SubResource("StandardMaterial3D_o1wte") + +[node name="GunkBody" parent="." index="2" node_paths=PackedStringArray("mesh_instance") instance=ExtResource("7_3ib1l")] +mask_dim = 64 +mesh_instance = NodePath("../Armature/Skeleton3D/WallSwitch_2") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="GunkBody" index="1"] +shape = SubResource("ConcavePolygonShape3D_1xqlp") + +[node name="LightAnimation" type="AnimationPlayer" parent="." index="3"] +libraries = { +"": SubResource("AnimationLibrary_6ueib") +} +autoplay = "error_blink" + +[node name="DangerLight" type="MeshInstance3D" parent="LightAnimation" index="0"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17, 0.24, 0.1) +mesh = SubResource("BoxMesh_g24yf") +skeleton = NodePath("../..") + +[node name="SuccessLight" type="MeshInstance3D" parent="LightAnimation" index="1"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.17, 0.18, 0.1) +mesh = SubResource("BoxMesh_a6hjm") +skeleton = NodePath("../..") + +[node name="Interactive" type="StaticBody3D" parent="." index="4"] +collision_layer = 2 +collision_mask = 0 +script = ExtResource("10_qw6jt") +disabled = true + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive" index="0"] +shape = SubResource("BoxShape3D_6maql") diff --git a/src/ui/hud/hud_theme.tres b/src/ui/hud/hud_theme.tres new file mode 100644 index 0000000..3a6a7c6 --- /dev/null +++ b/src/ui/hud/hud_theme.tres @@ -0,0 +1,7 @@ +[gd_resource type="Theme" format=3 uid="uid://b07fevr214mmr"] + +[resource] +Label/colors/font_color = Color(1, 1, 1, 1) +Label/colors/font_outline_color = Color(0, 0, 0, 1) +Label/constants/outline_size = 16 +Label/font_sizes/font_size = 32 diff --git a/src/ui/hud/player_hud.gd b/src/ui/hud/player_hud.gd new file mode 100644 index 0000000..2ed164d --- /dev/null +++ b/src/ui/hud/player_hud.gd @@ -0,0 +1,37 @@ +class_name PlayerHUD extends Control + +const TRANSITION_TIME := 0.05 + +const COLOR_VISIBLE := Color("#ffffffee") +const COLOR_DISABLED := Color("#cccccc44") +const COLOR_INVISIBLE := Color("#ffffff00") + +@onready var interact_hud: Control = %InteractHUD + + +func _transition_color(element: CanvasItem, color: Color) -> void: + create_tween().tween_property(element, "modulate", color, TRANSITION_TIME).set_trans( + Tween.TRANS_CUBIC + ) + + +func _to_visible(element: Control) -> void: + _transition_color(element, COLOR_VISIBLE) + + +func _to_disabled(element: Control) -> void: + _transition_color(element, COLOR_DISABLED) + + +func _to_invisible(element: Control) -> void: + _transition_color(element, COLOR_INVISIBLE) + + +func select_interactive(prop: Interactive) -> void: + if prop: + if prop.disabled: + _to_disabled(interact_hud) + else: + _to_visible(interact_hud) + else: + _to_invisible(interact_hud) diff --git a/src/ui/hud/player_hud.tscn b/src/ui/hud/player_hud.tscn new file mode 100644 index 0000000..57ef2bc --- /dev/null +++ b/src/ui/hud/player_hud.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=3 format=3 uid="uid://dq1x21tq06dud"] + +[ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"] +[ext_resource type="Script" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"] + +[node name="PlayerHUD" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +theme = ExtResource("1_lirk3") +script = ExtResource("2_j6lpx") + +[node name="InteractHUD" type="Control" parent="."] +unique_name_in_owner = true +modulate = Color(1, 1, 1, 0.866667) +custom_minimum_size = Vector2(400, 400) +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -200.0 +offset_top = -100.0 +offset_right = 200.0 +offset_bottom = 100.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 + +[node name="Label" type="Label" parent="InteractHUD"] +layout_mode = 1 +anchors_preset = 7 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +offset_left = -20.0 +offset_top = -23.0 +offset_right = 20.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "Press [E] to use" diff --git a/src/world/gunk_body/gunk_body.gd b/src/world/gunk_body/gunk_body.gd index 21bf110..4fa34f2 100644 --- a/src/world/gunk_body/gunk_body.gd +++ b/src/world/gunk_body/gunk_body.gd @@ -3,10 +3,11 @@ class_name GunkBody extends StaticBody3D const CONTINUITY_LIMIT := 128 const BUFFER_LIMIT := 3 -const FACE_EPSILON := 0.4 +const FACE_EPSILON := 0.01 const MASK_COLOR := Color.RED @export var mask_dim := 256 +@export var mesh_instance: MeshInstance3D var meshtool := MeshDataTool.new() @@ -19,13 +20,14 @@ var _multiline_width := 1.0 var _clear_total := 0.0 var _clear_total_dirty := true -@onready var mesh_instance: MeshInstance3D = $MeshInstance3D @onready var mesh: ArrayMesh = mesh_instance.mesh @onready var gunk_mat: ShaderMaterial = mesh_instance.get_surface_override_material(0).next_pass @onready var mask_viewport: SubViewport = %MaskViewport @onready var mask_control: DrawController = %MaskControl +@onready var debug_draw: DebugDraw = $DebugDraw + func _ready() -> void: mask_viewport.size = Vector2(mask_dim, mask_dim) @@ -129,6 +131,8 @@ func paint_dot(point: Vector3, normal: Vector3, radius: float) -> void: ## Paint a continuous line on the gunk mask if called on successive frames. func paint_continuous(point: Vector3, normal: Vector3, width: float) -> void: + debug_draw.draw_vector(normal, point) + var px := _get_px(point, normal) if _polyline_buffer and px.distance_to(_polyline_buffer[0]) <= CONTINUITY_LIMIT: _polyline_buffer.push_front(px) diff --git a/src/world/gunk_body/gunk_body.tscn b/src/world/gunk_body/gunk_body.tscn index 2d76e6d..4c0be0f 100644 --- a/src/world/gunk_body/gunk_body.tscn +++ b/src/world/gunk_body/gunk_body.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=3 format=3 uid="uid://c2omlx4ptrc01"] +[gd_scene load_steps=4 format=3 uid="uid://c2omlx4ptrc01"] [ext_resource type="Script" path="res://src/world/gunk_body/gunk_body.gd" id="1_qqbpr"] [ext_resource type="Script" path="res://src/world/gunk_body/draw_controller.gd" id="2_kkcjw"] +[ext_resource type="Script" path="res://levels/sandbox/debug_draw.gd" id="3_m8wx4"] [node name="GunkBody" type="StaticBody3D"] script = ExtResource("1_qqbpr") @@ -23,4 +24,11 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("2_kkcjw") +[node name="DebugDraw" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +script = ExtResource("3_m8wx4") + [connection signal="painted" from="MaskViewport/MaskControl" to="." method="_on_mask_painted"]