Add production bathymetric sonar slice
This commit is contained in:
1 parent
a18e82eb44
commit
7613daee84
28 files changed
+1825
-87
No files matched your search
@@ -15,6 +15,10 @@ const COLOR_CRITICAL := Color(1.0, 0.42, 0.31, 1.0)
|
||||
@onready var _integrity_label: Label3D = %IntegrityLabel
|
||||
@onready var _return_label: Label3D = %ReturnLabel
|
||||
@onready var _status_label: Label3D = %StatusLabel
|
||||
@onready var _sonar_screen: MeshInstance3D = %SonarScreen
|
||||
@onready var _sonar_placeholder: Label3D = %SonarPlaceholder
|
||||
|
||||
var _sonar_texture: Texture2D
|
||||
|
||||
|
||||
func present(update: DiveUpdate, telemetry: VehicleTelemetry) -> void:
|
||||
@@ -79,6 +83,22 @@ func return_text() -> String:
|
||||
return _return_label.text
|
||||
|
||||
|
||||
func attach_sonar_texture(texture: Texture2D) -> void:
|
||||
_sonar_texture = texture
|
||||
var material := StandardMaterial3D.new()
|
||||
material.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
|
||||
material.albedo_texture = texture
|
||||
material.emission_enabled = true
|
||||
material.emission_texture = texture
|
||||
material.emission_energy_multiplier = 1.7
|
||||
_sonar_screen.material_override = material
|
||||
_sonar_placeholder.visible = false
|
||||
|
||||
|
||||
func sonar_texture() -> Texture2D:
|
||||
return _sonar_texture
|
||||
|
||||
|
||||
func _return_text(estimate: ReturnEstimate) -> String:
|
||||
match estimate.status:
|
||||
ReturnEstimate.Status.SAFE:
|
||||
|
||||
@@ -395,6 +395,7 @@ mesh = SubResource("ScreenQuadMesh")
|
||||
material_override = SubResource("ScreenMaterial")
|
||||
|
||||
[node name="SonarPlaceholder" type="Label3D" parent="SonarMonitor"]
|
||||
unique_name_in_owner = true
|
||||
position = Vector3(0, 0.025, 0.068)
|
||||
pixel_size = 0.0009
|
||||
font_size = 16
|
||||
|
||||
Reference in new issue
Block a user