GunkBody tests planar distance to point to disambiguate parallel planes

This commit is contained in:
Rob Kelly 2025-03-14 15:27:55 -06:00
parent 6746b42326
commit 19ea9fca6d
23 changed files with 448 additions and 90 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
# Blender 4.3.2 MTL File: 'parallel.blend'
# www.blender.org

View File

@ -0,0 +1,93 @@
# Blender 4.3.2
# www.blender.org
mtllib parallel.mtl
o Cube
v -1.000000 -1.000000 0.100000
v -1.000000 1.000000 0.100000
v -1.000000 1.000000 -0.100000
v 1.000000 -1.000000 0.100000
v 1.000000 1.000000 0.100000
v 1.000000 1.000000 -0.100000
v -1.000000 -0.800000 0.100000
v -1.000000 -0.800000 -0.100000
v 1.000000 -0.800000 -0.100000
v 1.000000 -0.800000 0.100000
v -1.000000 -0.800000 -2.100000
v 1.000000 -0.800000 -2.100000
v -1.000000 -0.800000 -2.300000
v -1.000000 -1.000000 -2.300000
v 1.000000 -1.000000 -2.300000
v 1.000000 -0.800000 -2.300000
v -1.000000 1.000000 -2.100000
v 1.000000 1.000000 -2.100000
v -1.000000 1.000000 -2.300000
v 1.000000 1.000000 -2.300000
vn -1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 -1.0000
vn 1.0000 -0.0000 -0.0000
vn -0.0000 -0.0000 1.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 1.0000 -0.0000
vt 0.558824 0.705883
vt 0.294118 0.705883
vt 0.294118 0.676471
vt 0.558824 0.676471
vt 0.000000 0.264706
vt 0.000000 0.000000
vt 0.294118 0.000000
vt 0.294118 0.264706
vt 0.558824 0.029412
vt 0.294118 0.029412
vt 0.294118 0.000000
vt 0.558824 0.000000
vt 0.882353 0.705882
vt 0.882353 0.970588
vt 0.588235 0.970588
vt 0.588235 0.705882
vt 0.588235 0.352941
vt 0.588235 0.000000
vt 0.882353 -0.000000
vt 0.882353 0.352941
vt 0.882353 1.000000
vt 0.588235 1.000000
vt 0.882353 0.676471
vt 0.588235 0.676471
vt 0.588235 0.000000
vt 0.588235 0.352941
vt 0.558823 0.352941
vt 0.558823 0.323530
vt 0.294118 0.558823
vt 0.000000 0.558823
vt 0.558824 0.382353
vt 0.558824 0.352941
vt 0.588235 0.352941
vt 0.588235 0.705883
vt 0.588235 0.647059
vt 0.882353 0.647059
vt 0.294118 0.352941
vt 0.294118 0.323530
vt 0.588235 0.352941
vt 0.882353 0.352941
vt 0.882353 0.382353
vt 0.588235 0.382353
vt 0.294118 0.823529
vt 0.000000 0.823529
vt 0.294118 0.382353
vt 0.294118 0.352941
s 0
f 7/1/1 2/2/1 3/3/1 8/4/1
f 8/5/2 3/6/2 6/7/2 9/8/2
f 9/9/3 6/10/3 5/11/3 10/12/3
f 10/13/4 5/14/4 2/15/4 7/16/4
f 1/17/5 14/18/5 15/19/5 4/20/5
f 6/21/6 3/22/6 2/15/6 5/14/6
f 4/23/4 10/13/4 7/16/4 1/24/4
f 4/25/3 15/26/3 16/27/3 12/28/3 9/9/3 10/12/3
f 8/5/6 9/8/6 12/29/6 11/30/6
f 8/4/1 11/31/1 13/32/1 14/33/1 1/34/1 7/1/1
f 14/24/2 13/35/2 16/36/2 15/23/2
f 12/28/3 16/27/3 20/37/3 18/38/3
f 17/39/6 18/40/6 20/41/6 19/42/6
f 16/36/2 13/35/2 19/42/2 20/41/2
f 11/30/4 12/29/4 18/43/4 17/44/4
f 13/32/1 11/31/1 17/45/1 19/46/1

View File

@ -0,0 +1,25 @@
[remap]
importer="wavefront_obj"
importer_version=1
type="Mesh"
uid="uid://ckkba8tby7cyi"
path="res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh"
[deps]
files=["res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh"]
source_file="res://assets/props/parallel/parallel.obj"
dest_files=["res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh", "res://.godot/imported/parallel.obj-d3d9792b2ea8dd2e5a7908fc945bf809.mesh"]
[params]
generate_tangents=true
generate_lods=true
generate_shadow_mesh=true
generate_lightmap_uv2=false
generate_lightmap_uv2_texel_size=0.2
scale_mesh=Vector3(1, 1, 1)
offset_mesh=Vector3(0, 0, 0)
force_disable_mesh_compression=false

View File

@ -9,9 +9,11 @@ extends Node3D
@onready var nodule_spawn_point: Marker3D = %NoduleSpawnPoint @onready var nodule_spawn_point: Marker3D = %NoduleSpawnPoint
@onready var alarm_spawn_point: Marker3D = %AlarmSpawnPoint @onready var alarm_spawn_point: Marker3D = %AlarmSpawnPoint
@onready var signal_test_spawn_point: Marker3D = %SignalTestSpawnPoint
static var nodule_scene: PackedScene = load("res://src/world/gunk_node/grunk_nodule.tscn") static var nodule_scene: PackedScene = load("res://src/world/gunk_node/grunk_nodule.tscn")
static var alarm_scene: PackedScene = load("res://src/world/mechanics/alarm/gunk_alarm.tscn") static var alarm_scene: PackedScene = load("res://src/world/mechanics/alarm/gunk_alarm.tscn")
static var signal_test_scene: PackedScene = load("res://levels/mechanic_test/signal_test.tscn")
func reset() -> void: func reset() -> void:
@ -20,6 +22,7 @@ func reset() -> void:
Callable(bulkhead, "close").call() Callable(bulkhead, "close").call()
Callable(open_switch, "enable").call() Callable(open_switch, "enable").call()
Callable(close_switch, "disable").call() Callable(close_switch, "disable").call()
_do_spawn(signal_test_spawn_point, signal_test_scene)
func _do_spawn(spawn_point: Node3D, scene: PackedScene) -> void: func _do_spawn(spawn_point: Node3D, scene: PackedScene) -> void:
@ -38,6 +41,6 @@ func spawn_alarm() -> void:
func trigger_spawned_alarm() -> void: func trigger_spawned_alarm() -> void:
var alarm: GunkAlarm = alarm_spawn_point.get_child(0) var alarm := alarm_spawn_point.get_child(0)
if alarm: if alarm:
alarm.trigger() Callable(alarm, "trigger").call()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=42 format=4 uid="uid://b8rv6dg4tgaeb"] [gd_scene load_steps=37 format=4 uid="uid://b8rv6dg4tgaeb"]
[ext_resource type="Script" uid="uid://bvua1l2hb3an6" path="res://levels/mechanic_test/mechanic_test.gd" id="1_bg05n"] [ext_resource type="Script" uid="uid://bvua1l2hb3an6" path="res://levels/mechanic_test/mechanic_test.gd" id="1_bg05n"]
[ext_resource type="PackedScene" uid="uid://bwe2jdmvinhqd" path="res://src/player/player.tscn" id="1_goufh"] [ext_resource type="PackedScene" uid="uid://bwe2jdmvinhqd" path="res://src/player/player.tscn" id="1_goufh"]
@ -8,12 +8,7 @@
[ext_resource type="Texture2D" uid="uid://8cm835h4gxwe" path="res://assets/debug_mask.png" id="5_x2vho"] [ext_resource type="Texture2D" uid="uid://8cm835h4gxwe" path="res://assets/debug_mask.png" id="5_x2vho"]
[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_x2vho"] [ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="6_x2vho"]
[ext_resource type="PackedScene" uid="uid://dvma1hufsl6mc" path="res://src/props/bulkhead/bulkhead.tscn" id="8_0j1ke"] [ext_resource type="PackedScene" uid="uid://dvma1hufsl6mc" path="res://src/props/bulkhead/bulkhead.tscn" id="8_0j1ke"]
[ext_resource type="Texture2D" uid="uid://m2qxenym1otw" path="res://assets/level/wall/wall_2_C.png" id="9_cgmn0"] [ext_resource type="PackedScene" uid="uid://b5jubpjj3d277" path="res://levels/mechanic_test/signal_test.tscn" id="9_x2vho"]
[ext_resource type="Texture2D" uid="uid://begn6qloo0m1q" path="res://assets/level/wall/wall_2_M.png" id="10_aix42"]
[ext_resource type="PackedScene" uid="uid://bttust5ohud8e" path="res://src/world/mechanics/relay/gunk_relay.tscn" id="10_iyuyb"]
[ext_resource type="Texture2D" uid="uid://cpdrvdu3qt62t" path="res://assets/level/wall/wall_2_N.png" id="11_6frcc"]
[ext_resource type="PackedScene" uid="uid://dgeg3kkogm71m" path="res://src/world/mechanics/alarm/gunk_alarm.tscn" id="11_qjnj2"]
[ext_resource type="Texture2D" uid="uid://ba5vvrx730go8" path="res://assets/level/wall/wall_2_R.png" id="12_7cbja"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_goufh"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_goufh"]
@ -132,9 +127,17 @@ shadow_mesh = SubResource("ArrayMesh_0j1ke")
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_qjnj2"] [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_qjnj2"]
data = PackedVector3Array(-1.5, 0, -6, -1.5, 0, 6, -1.5, 3, -6, -1.5, 3, -6, -1.5, 0, 6, -1.5, 3, 6, 1.5, 0, 6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, 6, 1.5, 0, -6, 1.5, 3, -6, -1.5, 0, 6, -1.5, 0, -6, 1.5, 0, 6, 1.5, 0, 6, -1.5, 0, -6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, -6, -1.5, 3, 6, -1.5, 3, 6, 1.5, 3, -6, -1.5, 3, -6) data = PackedVector3Array(-1.5, 0, -6, -1.5, 0, 6, -1.5, 3, -6, -1.5, 3, -6, -1.5, 0, 6, -1.5, 3, 6, 1.5, 0, 6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, 6, 1.5, 0, -6, 1.5, 3, -6, -1.5, 0, 6, -1.5, 0, -6, 1.5, 0, 6, 1.5, 0, 6, -1.5, 0, -6, 1.5, 0, -6, 1.5, 3, 6, 1.5, 3, -6, -1.5, 3, 6, -1.5, 3, 6, 1.5, 3, -6, -1.5, 3, -6)
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_f342o"] [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_x2vho"]
load_path = "res://.godot/imported/debug_mask.png-fd2bc783338ed9439fe81a4eef9d86da.s3tc.ctex" load_path = "res://.godot/imported/debug_mask.png-fd2bc783338ed9439fe81a4eef9d86da.s3tc.ctex"
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_f342o"]
width = 256
height = 256
depth = 32
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("6_x2vho")
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_iyuyb"] [sub_resource type="NoiseTexture3D" id="NoiseTexture3D_iyuyb"]
width = 256 width = 256
height = 256 height = 256
@ -143,15 +146,7 @@ seamless = true
seamless_blend_skirt = 0.5 seamless_blend_skirt = 0.5
noise = ExtResource("6_x2vho") noise = ExtResource("6_x2vho")
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_qjnj2"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_qjnj2"]
width = 256
height = 256
depth = 32
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("6_x2vho")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_awnx0"]
resource_local_to_scene = true resource_local_to_scene = true
render_priority = 0 render_priority = 0
shader = ExtResource("5_0j1ke") shader = ExtResource("5_0j1ke")
@ -166,58 +161,50 @@ shader_parameter/emission_strength = 0.02
shader_parameter/uv_scale = Vector2(4, 4) shader_parameter/uv_scale = Vector2(4, 4)
shader_parameter/time_scale = 0.2 shader_parameter/time_scale = 0.2
shader_parameter/edge_bleed = 0.25 shader_parameter/edge_bleed = 0.25
shader_parameter/gunk_mask = SubResource("CompressedTexture2D_f342o") shader_parameter/gunk_mask = SubResource("CompressedTexture2D_x2vho")
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_iyuyb") shader_parameter/gunk_noise = SubResource("NoiseTexture3D_f342o")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_qjnj2") shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_iyuyb")
shader_parameter/jitter_magnitude = 0.0 shader_parameter/jitter_magnitude = 0.0
shader_parameter/jitter_time_scale = 0.1 shader_parameter/jitter_time_scale = 0.1
shader_parameter/vertex_inflation = 0.0 shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0 shader_parameter/inflation_pixellation = 10.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgmn0"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_awnx0"]
resource_local_to_scene = true albedo_color = Color(1, 0.403922, 1, 1)
cull_mode = 2
albedo_texture = ExtResource("9_cgmn0")
metallic = 1.0
metallic_texture = ExtResource("10_aix42")
roughness_texture = ExtResource("12_7cbja")
normal_enabled = true
normal_texture = ExtResource("11_6frcc")
texture_filter = 4
[sub_resource type="ArrayMesh" id="ArrayMesh_ix0jw"] [sub_resource type="ArrayMesh" id="ArrayMesh_cgmn0"]
_surfaces = [{ _surfaces = [{
"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3), "aabb": AABB(-1, -1, -2.3, 2, 2, 2.4),
"format": 34896613377, "format": 34896613377,
"index_count": 6, "index_count": 108,
"index_data": PackedByteArray("AAABAAIAAgABAAMA"), "index_data": PackedByteArray("AAABAAIAAgADAAAAAAADAAQAAgAFAAMAAgABAAUAAwAGAAQAAwAFAAYABAAHAAAAAAAHAAEABAAGAAcABwAIAAEABgAIAAcACQAFAAEAAQAIAAkACgAIAAYABgAFAAoACwAJAAgACwAIAAwADAAIAAoADQAJAAsADQAFAAkADAANAAsADgAFAA0ADgANAAwACgAFAA8ADwAFAA4ACgAPABAADgAMABEADAAKABIAEgAKABAAEQAMABIAEAAPABMADwAOABMAEAATABIAEwAOABEAEgATABEA"),
"name": "Plane", "name": "Cube",
"primitive": 3, "primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0), "uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 4, "vertex_count": 20,
"vertex_data": PackedByteArray("//8AAP//AAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAA=") "vertex_data": PackedByteArray("AAD/////AAAAAJkZ//8AAAAA//+p6gAA/////6nqAAD///////8AAAAAmRmp6gAA//+ZGanqAAD//5kZ//8AAP//AAD//wAAAAAAAP//AAD//5kZVRUAAP//AAAAAAAA//+ZGQAAAAAAAAAAAAAAAAAAmRkAAAAAAACZGVUVAAD/////VRUAAAAA//8AAAAA/////wAAAAAAAP//VRUAAA==")
}] }]
blend_shape_mode = 0 blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_xrfi2"] [sub_resource type="ArrayMesh" id="ArrayMesh_aix42"]
_surfaces = [{ _surfaces = [{
"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3), "aabb": AABB(-1, -1, -2.3, 2, 2, 2.4),
"attribute_data": PackedByteArray("/////wAA/////wAAAAAAAA=="), "attribute_data": PackedByteArray("S0tKSw6PSktLS9JSDo/SUpWWSkuVlqWlDo+lpQ6PHZ5LSx2eS0ulpQAA//8AADu8S0v//0tLO7xLS3f4Do93+EtL//8Oj///lZb//w6PLK0Oj6WllZalpUtLpaVLSyyt4eGHB+HhS0uVlocHlZZLS+Hh0lKVltJSlZb//5WWpaXh4f//4eGlpZWWAADh4QAAlZaHB+HhhwdLSzu8AAA7vEtL8HAAAPBwlZZZWpWW0lLh4Vla4eHSUpWWHZ7h4R2e4eGlpZWWpaXh4R2elZYdnktL8HAAAPBwS0stLQAALS0="),
"format": 34896613399, "format": 34896613399,
"index_count": 6, "index_count": 108,
"index_data": PackedByteArray("AAABAAIAAgABAAMA"), "index_data": PackedByteArray("AAABAAIAAgABAAMABAADAAEABQADAAQABgADAAUABwADAAYABwAGAAgACAAGAAkACgALAAwADAALAA0ADgAPABAAEAAPABEADwASABEAEwASAA8AFAASABMAFQASABQAFAATABYAFgATABcAGAAZABoAGgAZABsAGQAcABsAGwAcAB0AHgAfACAAIAAfACEAIgAjACQAJAAjACUAJgAnACgAKAAnACkAKgArACwALAArAC0AKgAsAC4ALgAsAC8AMAAxADIAMgAxADMANAA1ADYANgA1ADcA"),
"material": SubResource("StandardMaterial3D_cgmn0"), "material": SubResource("StandardMaterial3D_awnx0"),
"name": "Plane", "name": "Cube",
"primitive": 3, "primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0), "uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 4, "vertex_count": 56,
"vertex_data": PackedByteArray("//8AAP///78AAAAA////v///AAAAAP+/AAAAAAAA/7////9/////f////3////9/") "vertex_data": PackedByteArray("AAD/////VNUAAJkZ//9U1QAA//+p6lTVAACZGanqVNUAAAAA//9U1QAAAAAAAFTVAACZGQAAVNUAAJkZVRVU1QAA//9VFVTVAAD//wAAVNUAAP//qer//wAAmRmp6v///////6nq/////5kZqer///////+p6lTV//+ZGanqVNX///////9U1f//mRn//1TV//8AAP//VNX//5kZVRVT1f//mRkAAFTV//8AAAAAVNX/////AABU1f////9VFVTV////////AID//5kZ//8AgAAA/////wCAAACZGf//AID//wAA//8AgAAAAAD//wCAAAAAAAAA/78AAAAA////v///AAAAAP+///8AAP///78AAP//qer/v/////+p6v+/AAD//////7//////////v///mRmp6v+/AACZGanq/7///5kZVRX/vwAAmRlVFf+/AACZGQAA//8AAAAAAAD/////mRkAAP////8AAAAA//8AAP//AAD///////8AAP///////1UV/78AAP//VRX/v/////8AAP+/AAD//wAA/7///5kZVRUAgAAAmRlVFQCA/////1UVAIAAAP//VRUAgFRVqqpUVaqqVFWqqlRVqapUVamqVFWpqlRVqqpUVaqqVFWqqlRVqqr///9/////f////3////9/qqpUVamqVFWqqlRVqqpUVamqVFWpqlNVqapUVaqqVFWqqlRVqqpUVf9/////f////3////9/////f////3///wAA/38AAP9/AAD/fwAA/3////9/////f////3////9/////f////3////9/////f////3////9/////f////3////9/////f////3////9/////f////3//f////3////9/////f///")
}] }]
blend_shape_mode = 0 blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_ix0jw") shadow_mesh = SubResource("ArrayMesh_cgmn0")
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_x2vho"] [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_x2vho"]
data = PackedVector3Array(1.5, 0, 1.5, -1.5, 0, 1.5, 1.5, 0, -1.5, 1.5, 0, -1.5, -1.5, 0, 1.5, -1.5, 0, -1.5) data = PackedVector3Array(-1, 1, 0.1, -1, -0.8, 0.1, -1, 1, -0.1, -1, 1, -0.1, -1, -0.8, 0.1, -1, -0.8, -0.1, -1, -1, 0.1, -1, -0.8, -0.1, -1, -0.8, 0.1, -1, -1, -2.3, -1, -0.8, -0.1, -1, -1, 0.1, -1, -0.8, -2.3, -1, -0.8, -0.1, -1, -1, -2.3, -1, -0.8, -2.1, -1, -0.8, -0.1, -1, -0.8, -2.3, -1, -0.8, -2.1, -1, -0.8, -2.3, -1, 1, -2.1, -1, 1, -2.1, -1, -0.8, -2.3, -1, 1, -2.3, -1, 1, -0.1, -1, -0.8, -0.1, 1, 1, -0.1, 1, 1, -0.1, -1, -0.8, -0.1, 1, -0.8, -0.1, 1, 1, -0.1, 1, -0.8, -0.1, 1, 1, 0.1, 1, 1, 0.1, 1, -0.8, -0.1, 1, -0.8, 0.1, 1, -0.8, -0.1, 1, -1, 0.1, 1, -0.8, 0.1, 1, -0.8, -2.1, 1, -1, 0.1, 1, -0.8, -0.1, 1, -0.8, -2.3, 1, -1, 0.1, 1, -0.8, -2.1, 1, -1, -2.3, 1, -1, 0.1, 1, -0.8, -2.3, 1, -0.8, -2.3, 1, -0.8, -2.1, 1, 1, -2.3, 1, 1, -2.3, 1, -0.8, -2.1, 1, 1, -2.1, 1, 1, 0.1, 1, -0.8, 0.1, -1, 1, 0.1, -1, 1, 0.1, 1, -0.8, 0.1, -1, -0.8, 0.1, 1, -0.8, 0.1, 1, -1, 0.1, -1, -0.8, 0.1, -1, -0.8, 0.1, 1, -1, 0.1, -1, -1, 0.1, -1, -1, -2.3, -1, -1, 0.1, 1, -1, -2.3, 1, -1, -2.3, -1, -1, 0.1, 1, -1, 0.1, -1, 1, -0.1, 1, 1, -0.1, -1, 1, 0.1, -1, 1, 0.1, 1, 1, -0.1, 1, 1, 0.1, 1, -0.8, -0.1, -1, -0.8, -0.1, 1, -0.8, -2.1, 1, -0.8, -2.1, -1, -0.8, -0.1, -1, -0.8, -2.1, -1, -0.8, -2.3, -1, -1, -2.3, 1, -0.8, -2.3, 1, -0.8, -2.3, -1, -1, -2.3, 1, -1, -2.3, -1, -0.8, -2.3, 1, -0.8, -2.3, -1, 1, -2.3, -1, 1, -2.3, 1, -0.8, -2.3, 1, 1, -2.3, 1, 1, -2.1, -1, 1, -2.1, 1, 1, -2.3, 1, 1, -2.3, -1, 1, -2.1, -1, 1, -2.3, 1, -0.8, -2.1, -1, -0.8, -2.1, 1, 1, -2.1, 1, 1, -2.1, -1, -0.8, -2.1, -1, 1, -2.1)
[node name="MechanicTest" type="Node3D"] [node name="MechanicTest" type="Node3D"]
script = ExtResource("1_bg05n") script = ExtResource("1_bg05n")
@ -369,37 +356,28 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.4, 0.35)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0.3) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0.3)
text = "Close" text = "Close"
[node name="SignalTest" type="Node3D" parent="."] [node name="SignalTestSpawnPoint" type="Marker3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, -6) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 0, -6)
[node name="Wall" parent="SignalTest" instance=ExtResource("4_2uiim")] [node name="SignalTest" parent="SignalTestSpawnPoint" instance=ExtResource("9_x2vho")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.5, 0)
source_gunk_material = SubResource("ShaderMaterial_awnx0")
[node name="MeshInstance3D" type="MeshInstance3D" parent="SignalTest/Wall"] [node name="PropTestSpawnPoint" type="Marker3D" parent="."]
mesh = SubResource("ArrayMesh_xrfi2") transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5, 0, 4.5)
[node name="CollisionShape3D" type="CollisionShape3D" parent="SignalTest/Wall"] [node name="PropTest" type="Node3D" parent="PropTestSpawnPoint"]
[node name="Parallel" parent="PropTestSpawnPoint/PropTest" instance=ExtResource("4_2uiim")]
transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 1, 1.5)
mask_dim = 128
source_gunk_material = SubResource("ShaderMaterial_qjnj2")
[node name="MeshInstance3D" type="MeshInstance3D" parent="PropTestSpawnPoint/PropTest/Parallel"]
mesh = SubResource("ArrayMesh_aix42")
[node name="CollisionShape3D" type="CollisionShape3D" parent="PropTestSpawnPoint/PropTest/Parallel"]
shape = SubResource("ConcavePolygonShape3D_x2vho") shape = SubResource("ConcavePolygonShape3D_x2vho")
[node name="WallSwitch" parent="SignalTest" instance=ExtResource("2_pka60")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.15, 1.45, 0.0999999)
[node name="GunkRelay" parent="SignalTest" instance=ExtResource("10_iyuyb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.45, 2.1, 0)
[node name="GunkRelay2" parent="SignalTest" instance=ExtResource("10_iyuyb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, 1.75, 0)
[node name="GunkRelay3" parent="SignalTest" instance=ExtResource("10_iyuyb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.95, 0)
[node name="GunkRelay4" parent="SignalTest" instance=ExtResource("10_iyuyb")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.45, 0)
[node name="GunkAlarm" parent="SignalTest" instance=ExtResource("11_qjnj2")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.9, 1.75, 0)
[connection signal="activated" from="ResetPodium/ResetSwitch" to="." method="reset"] [connection signal="activated" from="ResetPodium/ResetSwitch" to="." method="reset"]
[connection signal="activated" from="NoduleSpawner/WallSwitch" to="." method="spawn_nodule"] [connection signal="activated" from="NoduleSpawner/WallSwitch" to="." method="spawn_nodule"]
[connection signal="activated" from="AlarmSpawner/WallSwitch" to="." method="spawn_alarm"] [connection signal="activated" from="AlarmSpawner/WallSwitch" to="." method="spawn_alarm"]
@ -410,9 +388,3 @@ transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.9, 1
[connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead" method="close"] [connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead" method="close"]
[connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead/Podium/OpenSwitch" method="enable"] [connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead/Podium/OpenSwitch" method="enable"]
[connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead/Podium2/CloseSwitch" method="disable"] [connection signal="activated" from="Bulkhead/Podium2/CloseSwitch" to="Bulkhead/Podium2/CloseSwitch" method="disable"]
[connection signal="activated" from="SignalTest/WallSwitch" to="SignalTest/GunkRelay" method="trigger"]
[connection signal="triggered" from="SignalTest/GunkRelay" to="SignalTest/GunkRelay2" method="trigger"]
[connection signal="triggered" from="SignalTest/GunkRelay2" to="SignalTest/GunkRelay3" method="trigger"]
[connection signal="triggered" from="SignalTest/GunkRelay2" to="SignalTest/GunkRelay4" method="trigger"]
[connection signal="triggered" from="SignalTest/GunkRelay3" to="SignalTest/GunkAlarm" method="trigger"]
[connection signal="triggered" from="SignalTest/GunkRelay4" to="SignalTest/GunkAlarm" method="trigger"]

View File

@ -0,0 +1,137 @@
[gd_scene load_steps=19 format=3 uid="uid://b5jubpjj3d277"]
[ext_resource type="PackedScene" uid="uid://c2omlx4ptrc01" path="res://src/world/gunk_body/gunk_body.tscn" id="1_3u410"]
[ext_resource type="Shader" uid="uid://ckxc0ngd37rtk" path="res://src/shaders/gunk.gdshader" id="2_tfbib"]
[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="3_e8utx"]
[ext_resource type="Texture2D" uid="uid://m2qxenym1otw" path="res://assets/level/wall/wall_2_C.png" id="4_r07l4"]
[ext_resource type="Texture2D" uid="uid://begn6qloo0m1q" path="res://assets/level/wall/wall_2_M.png" id="5_67o2j"]
[ext_resource type="Texture2D" uid="uid://cpdrvdu3qt62t" path="res://assets/level/wall/wall_2_N.png" id="6_4yjoq"]
[ext_resource type="Texture2D" uid="uid://ba5vvrx730go8" path="res://assets/level/wall/wall_2_R.png" id="7_c27im"]
[ext_resource type="PackedScene" uid="uid://dgqx1h4dtkwma" path="res://src/world/mechanics/trigger/gunk_trigger.tscn" id="8_gx82l"]
[ext_resource type="PackedScene" uid="uid://bttust5ohud8e" path="res://src/world/mechanics/relay/gunk_relay.tscn" id="9_d4a3d"]
[ext_resource type="PackedScene" uid="uid://dgeg3kkogm71m" path="res://src/world/mechanics/alarm/gunk_alarm.tscn" id="10_l8xa5"]
[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_f342o"]
load_path = "res://.godot/imported/debug_mask.png-fd2bc783338ed9439fe81a4eef9d86da.s3tc.ctex"
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_iyuyb"]
width = 256
height = 256
depth = 32
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("3_e8utx")
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_qjnj2"]
width = 256
height = 256
depth = 32
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("3_e8utx")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_awnx0"]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("2_tfbib")
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 = 128.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(4, 4)
shader_parameter/time_scale = 0.2
shader_parameter/edge_bleed = 0.25
shader_parameter/gunk_mask = SubResource("CompressedTexture2D_f342o")
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_iyuyb")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_qjnj2")
shader_parameter/jitter_magnitude = 0.0
shader_parameter/jitter_time_scale = 0.1
shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cgmn0"]
resource_local_to_scene = true
cull_mode = 2
albedo_texture = ExtResource("4_r07l4")
metallic = 1.0
metallic_texture = ExtResource("5_67o2j")
roughness_texture = ExtResource("7_c27im")
normal_enabled = true
normal_texture = ExtResource("6_4yjoq")
texture_filter = 4
[sub_resource type="ArrayMesh" id="ArrayMesh_ix0jw"]
_surfaces = [{
"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3),
"format": 34896613377,
"index_count": 6,
"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0),
"name": "Plane",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 4,
"vertex_data": PackedByteArray(255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_xrfi2"]
_surfaces = [{
"aabb": AABB(-1.5, 0, -1.5, 3, 1e-05, 3),
"attribute_data": PackedByteArray(255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0),
"format": 34896613399,
"index_count": 6,
"index_data": PackedByteArray(0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 3, 0),
"material": SubResource("StandardMaterial3D_cgmn0"),
"name": "Plane",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 4,
"vertex_data": PackedByteArray(255, 255, 0, 0, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 255, 255, 0, 0, 0, 0, 255, 191, 0, 0, 0, 0, 0, 0, 255, 191, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127)
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_ix0jw")
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_x2vho"]
data = PackedVector3Array(1.5, 0, 1.5, -1.5, 0, 1.5, 1.5, 0, -1.5, 1.5, 0, -1.5, -1.5, 0, 1.5, -1.5, 0, -1.5)
[node name="SignalTest" type="Node3D"]
[node name="Wall" parent="." instance=ExtResource("1_3u410")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 1.5, 0)
mask_dim = 64
source_gunk_material = SubResource("ShaderMaterial_awnx0")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Wall"]
mesh = SubResource("ArrayMesh_xrfi2")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Wall"]
shape = SubResource("ConcavePolygonShape3D_x2vho")
[node name="GunkTrigger" parent="." instance=ExtResource("8_gx82l")]
transform = Transform3D(1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, -1, 1.5, 0)
[node name="GunkRelay" parent="." instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.45, 2.1, 0)
[node name="GunkRelay2" parent="." instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.15, 1.75, 0)
[node name="GunkRelay3" parent="." instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.95, 0)
[node name="GunkRelay4" parent="." instance=ExtResource("9_d4a3d")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.2, 1.45, 0)
[node name="GunkAlarm" parent="." instance=ExtResource("10_l8xa5")]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0.9, 1.75, 0)
[connection signal="destroyed" from="GunkTrigger" to="GunkRelay" method="trigger"]
[connection signal="triggered" from="GunkRelay" to="GunkRelay2" method="trigger"]
[connection signal="triggered" from="GunkRelay2" to="GunkRelay3" method="trigger"]
[connection signal="triggered" from="GunkRelay2" to="GunkRelay4" method="trigger"]
[connection signal="triggered" from="GunkRelay3" to="GunkAlarm" method="trigger"]
[connection signal="triggered" from="GunkRelay4" to="GunkAlarm" method="trigger"]

View File

@ -40,6 +40,10 @@ shader_parameter/edge_bleed = 0.25
shader_parameter/gunk_mask = SubResource("CompressedTexture2D_ow0bp") shader_parameter/gunk_mask = SubResource("CompressedTexture2D_ow0bp")
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_d70or") shader_parameter/gunk_noise = SubResource("NoiseTexture3D_d70or")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_0ksu8") shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_0ksu8")
shader_parameter/jitter_magnitude = 0.0
shader_parameter/jitter_time_scale = 0.1
shader_parameter/vertex_inflation = 0.0
shader_parameter/inflation_pixellation = 10.0
[resource] [resource]
next_pass = SubResource("ShaderMaterial_4xnwj") next_pass = SubResource("ShaderMaterial_4xnwj")

View File

@ -149,19 +149,21 @@ func get_clear_total() -> float:
## Returns -1 if the given point+normal does not lie on a mesh face within tolerance. ## Returns -1 if the given point+normal does not lie on a mesh face within tolerance.
func _get_face(point: Vector3, normal: Vector3) -> int: func _get_face(point: Vector3, normal: Vector3) -> int:
var min_i := -1 var min_i := -1
var min_sdist := INF var min_planar_dist := INF
for i in range(meshtool.get_face_count()): for i in range(meshtool.get_face_count()):
var sdist := meshtool.get_face_normal(i).distance_squared_to(normal) var sdist := meshtool.get_face_normal(i).distance_squared_to(normal)
if sdist > FACE_EPSILON or sdist > min_sdist: if sdist > FACE_EPSILON:
continue continue
# Normals match, so check if the point is on this face # Normals match, so check if the point is on this face
var v1 := meshtool.get_vertex(meshtool.get_face_vertex(i, 0)) var v1 := meshtool.get_vertex(meshtool.get_face_vertex(i, 0))
var v2 := meshtool.get_vertex(meshtool.get_face_vertex(i, 1)) var v2 := meshtool.get_vertex(meshtool.get_face_vertex(i, 1))
var v3 := meshtool.get_vertex(meshtool.get_face_vertex(i, 2)) var v3 := meshtool.get_vertex(meshtool.get_face_vertex(i, 2))
if GeometryTools.is_in_triangle(point, v1, v2, v3): if GeometryTools.is_in_triangle(point, v1, v2, v3):
var planar_dist := absf(Plane(v1, v2, v3).distance_to(point))
if planar_dist < min_planar_dist:
min_i = i min_i = i
min_sdist = sdist min_planar_dist = planar_dist
return min_i return min_i

View File

@ -13,6 +13,7 @@ source_gunk_material = ExtResource("2_hrldx")
[node name="MaskViewport" type="SubViewport" parent="."] [node name="MaskViewport" type="SubViewport" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
transparent_bg = true
handle_input_locally = false handle_input_locally = false
size = Vector2i(1024, 1024) size = Vector2i(1024, 1024)
render_target_clear_mode = 1 render_target_clear_mode = 1

View File

@ -11,7 +11,7 @@ extends GunkNode
func _process(delta: float) -> void: func _process(delta: float) -> void:
super._process(delta) super._process(delta)
var shader: ShaderMaterial = mesh_instance.mesh.surface_get_material(0) var shader: ShaderMaterial = mesh_instance.mesh.surface_get_material(0)
var value := _sustained_damage / durability var value := pct_damage()
shader.set_shader_parameter("jitter_time_scale", pow(value * jitter_scale_factor, 1.2)) shader.set_shader_parameter("jitter_time_scale", pow(value * jitter_scale_factor, 1.2))
shader.set_shader_parameter("vertex_inflation", pow(value * jitter_inflation_factor, 3)) shader.set_shader_parameter("vertex_inflation", pow(value * jitter_inflation_factor, 3))

View File

@ -26,6 +26,11 @@ func hit(damage: float = 0.05) -> void:
_hit() _hit()
## Return this node's current damage as a proportion of it's total durability.
func pct_damage() -> float:
return _sustained_damage / durability
func _hit() -> void: func _hit() -> void:
pass # Implemented in derived type pass # Implemented in derived type

View File

@ -1,4 +1,4 @@
class_name GunkAlarm extends GunkNode extends GunkNode
## Raises the grunk alert when triggered. ## Raises the grunk alert when triggered.
const ALERT_DELTA := 1 const ALERT_DELTA := 1
@ -23,7 +23,7 @@ func _process(delta: float) -> void:
super._process(delta) super._process(delta)
# TODO actual model & animation # TODO actual model & animation
var material: StandardMaterial3D = mesh_instance_3d.mesh.surface_get_material(0) var material: StandardMaterial3D = mesh_instance_3d.mesh.surface_get_material(0)
var value := 1.0 - _sustained_damage / durability var value := 1.0 - pct_damage()
material.albedo_color = Color(value, value, value) material.albedo_color = Color(value, value, value)

View File

@ -1,4 +1,4 @@
extends GunkNode class_name GunkRelay extends GunkNode
## Gunk node that rebroadcasts triggers to the network after a delay. ## Gunk node that rebroadcasts triggers to the network after a delay.
## Emitted when `trigger` is called, after a short delay. ## Emitted when `trigger` is called, after a short delay.

View File

@ -0,0 +1,11 @@
extends GunkNode
## Triggers other components when destroyed.
@onready var mesh_instance_3d: MeshInstance3D = %MeshInstance3D
func _process(delta: float) -> void:
super._process(delta)
# TODO proper animation
var mat: StandardMaterial3D = mesh_instance_3d.mesh.surface_get_material(0)
mat.emission_energy_multiplier = pct_damage()

View File

@ -0,0 +1 @@
uid://pfob2ntqm0xw

View File

@ -0,0 +1,58 @@
[gd_scene load_steps=6 format=4 uid="uid://dgqx1h4dtkwma"]
[ext_resource type="Script" uid="uid://pfob2ntqm0xw" path="res://src/world/mechanics/trigger/gunk_trigger.gd" id="1_t1c4j"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t1c4j"]
emission_enabled = true
emission = Color(1, 0, 0, 1)
emission_energy_multiplier = 0.0
[sub_resource type="ArrayMesh" id="ArrayMesh_swi0f"]
_surfaces = [{
"aabb": AABB(-0.894425, -1, -0.85064, 1.78885, 2, 1.70128),
"format": 34896613377,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAgABAAMAAQAAAAQAAwABAAUABQABAAQABAAAAAYABQAEAAcABwAEAAYAAwAFAAgACAAFAAcAAgADAAkACQADAAgAAAACAAoACgACAAkABgAAAAoACAAHAAsABwAGAAsACQAIAAsABgAKAAsACgAJAAsA"),
"name": "Icosphere",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 12,
"vertex_data": PackedByteArray("jOfBRhrPAAD/fwAA/38AAHJYwUb//wAAAADBRv9/AACM58FG5DAAAHJYwUYAAAAA//89uf9/AACMpz25AAAAAHIYPbnkMAAAchg9uRrPAACMpz25//8AAP9/////fwAA")
}]
blend_shape_mode = 0
[sub_resource type="ArrayMesh" id="ArrayMesh_ulsff"]
_surfaces = [{
"aabb": AABB(-0.894425, -1, -0.85064, 1.78885, 2, 1.70128),
"attribute_data": PackedByteArray("0UWv14su//9FF6/XFl3//9FFr9dcdK/X//+v17no//9z0a/Xc9Gv1y26///ooq/X6KKv16KL//9cdK/XXHSv19FFr9cWXWCv0UWv10UXr9eLLmCv//+v13PRr9e56GCvc9Gv1+iir9ctumCv6KKv11x0r9eii2CvFl1gr9FFr9eLLmCviy5gr0UXr9cAAGCvuehgr3PRr9ctumCvLbpgr+iir9eii2Cvootgr1x0r9cWXWCvFl1gr4suYK/RRRGHiy5grwAAYK9FFxGHuehgry26YK9z0RGHLbpgr6KLYK/oohGHootgrxZdYK9cdBGH"),
"format": 34896613399,
"index_count": 60,
"index_data": PackedByteArray("AAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA6ADsA"),
"material": SubResource("StandardMaterial3D_t1c4j"),
"name": "Icosphere",
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 60,
"vertex_data": PackedByteArray("jOfBRhrPZaf/fwAA/39lp3JYwUb//2Wn/38AAP9/DciM58FGGs8NyIznwUbkMA3IcljBRv//nLT/fwAA/3+ctAAAwUb/f5y0AADBRv9/2N3/fwAA/3/Y3XJYwUYAANjdcljBRgAAiPT/fwAA/3+I9IznwUbkMIj0jOfBRuQwW8CM58FGGs9bwP//Pbn/f1vAjOfBRhrP6Y5yWMFG///pjoynPbn//+mOcljBRv//GacAAMFG/38Zp3IYPbkazxmnAADBRv9/yNlyWMFGAADI2XIYPbnkMMjZcljBRgAAQfOM58FG5DBB84ynPbkAAEHz//89uf9/GaeM58FGGs8Zp4ynPbn//xmnjKc9uf//6Y5yWMFG///pjnIYPbkaz+mOchg9uRrPW8AAAMFG/39bwHIYPbnkMFvAchg9ueQwQfNyWMFGAABB84ynPbkAAEHzjKc9uQAAyNmM58FG5DDI2f//Pbn/f8jZ//89uf9/nLSMpz25//+ctP9/////f5y0jKc9uf//ZadyGD25Gs9lp/9/////f2Wnchg9uRrPDchyGD255DANyP9/////fw3Ichg9ueQwiPSMpz25AACI9P9/////f4j0jKc9uQAA2N3//z25/3/Y3f9/////f9jdbylFZG8pRWRvKUVkLWCkPy1gpD8tYKQ/7DOZzewzmc3sM5nNSkmH7UpJh+1KSYftn3mdLp95nS6feZ0uz3VfFM91XxTPdV8UzFJcNMxSXDTMUlw092Nt7fdjbe33Y23t/2+Y+v9vmPr/b5j6RH6lDER+pQxEfqUMB5yREgeckRIHnJESMq2iyzKtossyraLLL4qf6y+Kn+svip/ruoFZ87qBWfO6gVnz/49mBf+PZgX/j2YFEsxlMhLMZTISzGUyj9a5m4/WuZuP1rmb0Z9awNGfWsDRn1rAX4Zh0V+GYdFfhmHRtLZ3ErS2dxK0tncS")
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_swi0f")
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_t1c4j"]
data = PackedVector3Array(0.7236, -0.4472, 0.5257, 0, -1, 0, -0.2764, -0.4472, 0.8506, 0, -1, 0, 0.7236, -0.4472, 0.5257, 0.7236, -0.4472, -0.5257, -0.2764, -0.4472, 0.8506, 0, -1, 0, -0.8944, -0.4472, 0, -0.8944, -0.4472, 0, 0, -1, 0, -0.2764, -0.4472, -0.8506, -0.2764, -0.4472, -0.8506, 0, -1, 0, 0.7236, -0.4472, -0.5257, 0.7236, -0.4472, -0.5257, 0.7236, -0.4472, 0.5257, 0.8944, 0.4472, 0, 0.7236, -0.4472, 0.5257, -0.2764, -0.4472, 0.8506, 0.2764, 0.4472, 0.8506, -0.2764, -0.4472, 0.8506, -0.8944, -0.4472, 0, -0.7236, 0.4472, 0.5257, -0.8944, -0.4472, 0, -0.2764, -0.4472, -0.8506, -0.7236, 0.4472, -0.5257, -0.2764, -0.4472, -0.8506, 0.7236, -0.4472, -0.5257, 0.2764, 0.4472, -0.8506, 0.8944, 0.4472, 0, 0.7236, -0.4472, 0.5257, 0.2764, 0.4472, 0.8506, 0.2764, 0.4472, 0.8506, -0.2764, -0.4472, 0.8506, -0.7236, 0.4472, 0.5257, -0.7236, 0.4472, 0.5257, -0.8944, -0.4472, 0, -0.7236, 0.4472, -0.5257, -0.7236, 0.4472, -0.5257, -0.2764, -0.4472, -0.8506, 0.2764, 0.4472, -0.8506, 0.2764, 0.4472, -0.8506, 0.7236, -0.4472, -0.5257, 0.8944, 0.4472, 0, 0.8944, 0.4472, 0, 0.2764, 0.4472, 0.8506, 0, 1, 0, 0.2764, 0.4472, 0.8506, -0.7236, 0.4472, 0.5257, 0, 1, 0, -0.7236, 0.4472, 0.5257, -0.7236, 0.4472, -0.5257, 0, 1, 0, -0.7236, 0.4472, -0.5257, 0.2764, 0.4472, -0.8506, 0, 1, 0, 0.2764, 0.4472, -0.8506, 0.8944, 0.4472, 0, 0, 1, 0)
[node name="GunkTrigger" type="StaticBody3D"]
collision_layer = 5
collision_mask = 0
script = ExtResource("1_t1c4j")
durability = 0.1
metadata/_custom_type_script = "uid://bypgxi0gy56yk"
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
mesh = SubResource("ArrayMesh_ulsff")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
shape = SubResource("ConcavePolygonShape3D_t1c4j")

View File

@ -0,0 +1,23 @@
extends GunkNode
## Triggers an alarm when connection to a target is lost.
const TRIGGER_SIGNAL := "trigger"
@export var entry_point: GunkRelay
@export var target: GunkNode
static func _build_path(current: GunkRelay, target: GunkNode) -> Array[GunkNode]:
for connection: Callable in current.triggered.get_connections():
var next_node := connection.get_object() as GunkNode
if next_node:
if next_node == target:
return [current, next_node]
var relay := next_node as GunkRelay
if relay:
var ret: Array[GunkNode] = [current]
# XXX
ret.append_array(_build_path(relay, target))
return ret
return []

View File

@ -0,0 +1 @@
uid://uw4lx3ohj6s4

View File

@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://baavay05afcj8"]
[ext_resource type="Script" uid="uid://uw4lx3ohj6s4" path="res://src/world/mechanics/watchdog/gunk_watchdog.gd" id="1_hr1mr"]
[sub_resource type="SphereMesh" id="SphereMesh_hr1mr"]
radius = 0.25
height = 0.5
[sub_resource type="SphereShape3D" id="SphereShape3D_lvqm8"]
radius = 0.25
[node name="GunkWatchdog" type="StaticBody3D"]
script = ExtResource("1_hr1mr")
metadata/_custom_type_script = "uid://bypgxi0gy56yk"
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("SphereMesh_hr1mr")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_lvqm8")

View File

@ -17,7 +17,7 @@
- [ ] #mechanics - [ ] #mechanics
- [x] [[grunk alert]] - [x] [[grunk alert]]
- [x] [[alarm]] - [x] [[alarm]]
- [ ] [[hotwire]] - [ ] [[watchdog]]
- [ ] [[tripwire]] - [ ] [[tripwire]]
- [ ] [[looker]] - [ ] [[looker]]
- [ ] [[listener]] - [ ] [[listener]]