Add realistic cockpit surface textures

This commit is contained in:
chindit committed 2026-10-03 09:30:56 +02:00
1 parent 5455ae7928
commit 0b79bf9b82
8 files changed
+160 -23

No files matched your search

+37 -12
View File
@@ -11,6 +11,7 @@ const CockpitMeshFactory = preload("res://game/presentation/cockpit/cockpit_mesh
var _materials: CockpitMaterialPalette
var _painted_steel: Material
var _dark_steel: Material
var _overhead_steel: Material
var _brass: Material
var _copper: Material
var _rubber: Material
@@ -65,10 +66,19 @@ func battery_needle_degrees() -> float:
return 0.0 if _analog_gauges == null else _analog_gauges.battery_needle_degrees()
func textures_are_loaded() -> bool:
return (
_materials != null
and _materials.overhead_steel.albedo_texture != null
and _materials.gauge_face.albedo_texture != null
)
func _create_materials() -> void:
_materials = CockpitMaterialPalette.new()
_painted_steel = _materials.painted_steel
_dark_steel = _materials.dark_steel
_overhead_steel = _materials.overhead_steel
_brass = _materials.brass
_copper = _materials.copper
_rubber = _materials.rubber
@@ -89,16 +99,21 @@ func _apply_materials_to_existing_cockpit() -> void:
_apply_material_to_paths(
_dark_steel,
[
"CabinShell/Ceiling",
"CabinShell/RearBulkhead",
"PortholeAssembly/LeftBulkhead",
"PortholeAssembly/RightBulkhead",
"PortholeAssembly/TopBulkhead",
"PortholeAssembly/BottomBulkhead",
"ThrottleLever",
"VerticalLever",
]
)
_apply_material_to_paths(
_overhead_steel,
[
"CabinShell/Ceiling",
"PortholeAssembly/TopBulkhead",
]
)
_apply_material_to_paths(
_brass,
[
@@ -216,27 +231,37 @@ func _build_overhead_console() -> void:
CockpitMeshFactory.add_box(
"BreakerHousing",
root,
Vector3(0.0, 0.90, -1.08),
Vector3(0.66, 0.13, 0.27),
_painted_steel,
Vector3(0.0, 0.94, -1.06),
Vector3(0.30, 0.09, 0.12),
_overhead_steel,
Vector3(-8.0, 0.0, 0.0)
)
CockpitMeshFactory.add_box(
"WarmLightDiffuser",
root,
Vector3(0.0, 0.835, -0.89),
Vector3(0.38, 0.018, 0.065),
Vector3(0.0, 0.895, -0.985),
Vector3(0.13, 0.010, 0.026),
_warm_emission,
Vector3(-8.0, 0.0, 0.0)
)
for switch_index in 7:
var x := -0.24 + switch_index * 0.08
for guard_index in 5:
var guard_x := -0.05 + guard_index * 0.025
CockpitMeshFactory.add_box(
"LampGuard",
root,
Vector3(guard_x, 0.896, -0.968),
Vector3(0.005, 0.045, 0.008),
_dark_steel,
Vector3(-8.0, 0.0, 0.0)
)
for switch_index in 5:
var x := -0.10 + switch_index * 0.05
CockpitMeshFactory.add_cylinder(
"BreakerSwitch",
root,
Vector3(x, 0.83, -0.88),
0.006,
0.035,
Vector3(x, 0.965, -0.985),
0.004,
0.018,
_rubber,
Vector3(90.0, 0.0, 0.0)
)