Files
Ransom-s-wake/game/presentation/cockpit/cockpit_pressure_bulkhead.gd
T
OlivierandClaude Opus 5.5 2f9b7c0894
Quality Gate / Quality Gate (pull_request) Successful in 9m4s
feat(cockpit): replace procedural cockpit with twelve scripted models
Instance twelve Blender-scripted glTF models in the cockpit scene and
rebuild the cabin around them: gauge panel, sonar, switch panel, alert
box, speaker, porthole, hull wall, caged lamps, gas bottle, handrails
and side consoles. Presentation only; no domain, application or world
rule changes beyond enabling glow in the test environment.

- Needles, alert lamps and sonar screen are driven by the existing
  snapshots; the alert box now carries SYS/ATTN/ALRM.
- Depth dial reads percent of certified depth.
- Sonar display restyled as a turquoise holographic relief with a
  shader grid and height scale; SubViewport matches the glass (960x604).
- Cabin lighting retuned: warm pooled lamp light, cool porthole rim,
  lamp shadows, dial backlight.
- Procedural stand-ins removed (bulkhead, tanks, consoles, levers,
  indicator columns, placeholder pipe run, dial face PNGs).
- Tests adapted where nodes disappeared; one assertion removed
  (pipe_segment_count) until the pipe kit is placed.
- Model .glb files are committed without LFS; textures Godot extracts
  next to them at import are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 21:36:57 +02:00

58 lines
1.6 KiB
GDScript

class_name CockpitPressureBulkhead
extends Node3D
## Imported pressure hull (end cap, knuckle and barrel in one shell) and the
## porthole bolted into it. Both models are instanced by `cockpit_interior.tscn`.
const WHITEBOX_NAMES: Array[String] = [
"LeftBulkhead",
"RightBulkhead",
"TopBulkhead",
"BottomBulkhead",
]
var _hull_shells: Array[Node] = []
var _porthole_frame: MeshInstance3D
var _porthole_glass: MeshInstance3D
func _ready() -> void:
var hull := get_node_or_null("HullWall")
if hull != null:
_hull_shells = hull.find_children("*", "MeshInstance3D", true, false)
_porthole_frame = _find_mesh("Porthole")
_porthole_glass = _find_mesh("PortholeGlass")
if _hull_shells.is_empty() or _porthole_frame == null or _porthole_glass == null:
push_error("Pressure hull or porthole model is missing a node")
return
_porthole_glass.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
func panel_count() -> int:
return _hull_shells.size()
func hull_shell() -> MeshInstance3D:
return null if _hull_shells.is_empty() else _hull_shells[0] as MeshInstance3D
func porthole_frame() -> MeshInstance3D:
return _porthole_frame
func porthole_glass() -> MeshInstance3D:
return _porthole_glass
func rectangular_whitebox_is_hidden() -> bool:
for node_name: String in WHITEBOX_NAMES:
var whitebox := get_parent().get_node_or_null(node_name) as MeshInstance3D
if whitebox != null and whitebox.visible:
return false
return true
func _find_mesh(mesh_name: String) -> MeshInstance3D:
var matches := find_children(mesh_name, "MeshInstance3D", true, false)
return null if matches.is_empty() else matches[0] as MeshInstance3D