feat(cockpit): replace procedural cockpit with twelve scripted models
Quality Gate / Quality Gate (pull_request) Successful in 9m4s
Quality Gate / Quality Gate (pull_request) Successful in 9m4s
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>
This commit is contained in:
1 parent
912123087f
commit
2f9b7c0894
45 files changed
+1353
-1603
No files matched your search
@@ -1,145 +1,36 @@
|
||||
class_name CockpitSonarConsole
|
||||
extends Node3D
|
||||
|
||||
const CockpitMaterialPalette = preload(
|
||||
"res://game/presentation/cockpit/cockpit_material_palette.gd"
|
||||
)
|
||||
const CockpitMeshFactory = preload(
|
||||
"res://game/presentation/cockpit/cockpit_mesh_factory.gd"
|
||||
)
|
||||
## Imported sonar monitor. Exposes its glass as the cockpit's `%SonarScreen` so
|
||||
## the instrument panel can put the shared sonar texture on it.
|
||||
|
||||
var _materials: CockpitMaterialPalette
|
||||
var _control_count := 0
|
||||
## Lamps and knobs are modelled into the housing mesh, not separate nodes:
|
||||
## three amber push-buttons and two knurled knobs (model contract).
|
||||
const HOUSING_CONTROL_COUNT := 5
|
||||
|
||||
var _housing: MeshInstance3D
|
||||
var _screen: MeshInstance3D
|
||||
|
||||
|
||||
func _init(materials: CockpitMaterialPalette) -> void:
|
||||
_materials = materials
|
||||
name = "SonarConsoleDetailing"
|
||||
_build_bezel()
|
||||
_build_grid()
|
||||
_build_control_strip()
|
||||
_build_mounting_hardware()
|
||||
func _ready() -> void:
|
||||
_housing = find_child("Sonar", true, false) as MeshInstance3D
|
||||
_screen = find_child("SonarScreen", true, false) as MeshInstance3D
|
||||
if _housing == null or _screen == null:
|
||||
push_error("Sonar model is missing its Sonar or SonarScreen node")
|
||||
return
|
||||
# The glass belongs to the imported scene; adopt it so the cockpit scene
|
||||
# can address it by unique name like any other instrument.
|
||||
_screen.owner = owner
|
||||
_screen.unique_name_in_owner = true
|
||||
|
||||
|
||||
func housing() -> MeshInstance3D:
|
||||
return _housing
|
||||
|
||||
|
||||
func screen() -> MeshInstance3D:
|
||||
return _screen
|
||||
|
||||
|
||||
func control_count() -> int:
|
||||
return _control_count
|
||||
|
||||
|
||||
func _build_bezel() -> void:
|
||||
CockpitMeshFactory.add_box(
|
||||
"UpperBezel",
|
||||
self,
|
||||
Vector3(-0.025, 0.151, 0.073),
|
||||
Vector3(0.41, 0.034, 0.035),
|
||||
_materials.brushed_steel
|
||||
)
|
||||
CockpitMeshFactory.add_box(
|
||||
"LowerBezel",
|
||||
self,
|
||||
Vector3(-0.025, -0.126, 0.073),
|
||||
Vector3(0.41, 0.034, 0.035),
|
||||
_materials.brushed_steel
|
||||
)
|
||||
for x: float in [-0.225, 0.175]:
|
||||
CockpitMeshFactory.add_box(
|
||||
"SideBezel",
|
||||
self,
|
||||
Vector3(x, 0.012, 0.073),
|
||||
Vector3(0.035, 0.31, 0.035),
|
||||
_materials.brushed_steel
|
||||
)
|
||||
var label := Label3D.new()
|
||||
label.name = "SonarPlate"
|
||||
label.text = "SONAR · BATHYMÉTRIE"
|
||||
label.font_size = 12
|
||||
label.pixel_size = 0.00062
|
||||
label.modulate = Color(0.7, 0.73, 0.64)
|
||||
label.position = Vector3(-0.04, 0.156, 0.097)
|
||||
add_child(label)
|
||||
|
||||
|
||||
func _build_control_strip() -> void:
|
||||
CockpitMeshFactory.add_box(
|
||||
"ControlStrip",
|
||||
self,
|
||||
Vector3(0.235, 0.012, 0.072),
|
||||
Vector3(0.075, 0.31, 0.04),
|
||||
_materials.dark_steel
|
||||
)
|
||||
var lamps: Array[StandardMaterial3D] = [
|
||||
_materials.indicator_amber,
|
||||
_materials.indicator_amber,
|
||||
_materials.indicator_green,
|
||||
]
|
||||
for index in 3:
|
||||
var y := 0.095 - index * 0.073
|
||||
CockpitMeshFactory.add_box(
|
||||
"SonarLampBezel",
|
||||
self,
|
||||
Vector3(0.235, y, 0.101),
|
||||
Vector3(0.044, 0.044, 0.018),
|
||||
_materials.brass
|
||||
)
|
||||
CockpitMeshFactory.add_sphere(
|
||||
"SonarLamp",
|
||||
self,
|
||||
Vector3(0.235, y, 0.116),
|
||||
0.013,
|
||||
lamps[index]
|
||||
)
|
||||
_control_count += 1
|
||||
CockpitMeshFactory.add_cylinder(
|
||||
"SonarGainKnob",
|
||||
self,
|
||||
Vector3(0.235, -0.102, 0.108),
|
||||
0.024,
|
||||
0.026,
|
||||
_materials.rubber,
|
||||
Vector3(90.0, 0.0, 0.0)
|
||||
)
|
||||
_control_count += 1
|
||||
|
||||
|
||||
func _build_grid() -> void:
|
||||
for x: float in [-0.145, -0.085, -0.025, 0.035, 0.095]:
|
||||
CockpitMeshFactory.add_box(
|
||||
"SonarGridVertical",
|
||||
self,
|
||||
Vector3(x, 0.012, 0.076),
|
||||
Vector3(0.0015, 0.215, 0.002),
|
||||
_materials.sonar_grid
|
||||
)
|
||||
for y: float in [-0.075, -0.025, 0.025, 0.075]:
|
||||
CockpitMeshFactory.add_box(
|
||||
"SonarGridHorizontal",
|
||||
self,
|
||||
Vector3(-0.025, y, 0.076),
|
||||
Vector3(0.33, 0.0015, 0.002),
|
||||
_materials.sonar_grid
|
||||
)
|
||||
|
||||
|
||||
func _build_mounting_hardware() -> void:
|
||||
for corner: Vector2 in [
|
||||
Vector2(-0.205, -0.105),
|
||||
Vector2(-0.205, 0.13),
|
||||
Vector2(0.195, -0.105),
|
||||
Vector2(0.195, 0.13),
|
||||
]:
|
||||
CockpitMeshFactory.add_cylinder(
|
||||
"SonarFastener",
|
||||
self,
|
||||
Vector3(corner.x, corner.y, 0.103),
|
||||
0.008,
|
||||
0.012,
|
||||
_materials.brass,
|
||||
Vector3(90.0, 0.0, 0.0)
|
||||
)
|
||||
CockpitMeshFactory.add_cylinder_between(
|
||||
"LeftSonarHandle",
|
||||
self,
|
||||
Vector3(-0.255, -0.09, 0.06),
|
||||
Vector3(-0.255, 0.11, 0.06),
|
||||
0.013,
|
||||
_materials.brass
|
||||
)
|
||||
return 0 if _housing == null else HOUSING_CONTROL_COUNT
|
||||
Reference in new issue
Block a user