fix sky
This commit is contained in:
@@ -322,6 +322,8 @@ shadow_proxy_system = NodePath("ShadowProxySystem")
|
||||
world_environment = NodePath("WorldEnvironment")
|
||||
sun_light = NodePath("SunLight")
|
||||
moon_light = NodePath("MoonLight")
|
||||
deterministic_seed = 5
|
||||
show_debug_panel = true
|
||||
|
||||
[node name="PresetLibrary" type="Node" parent="." unique_id=1947927418]
|
||||
script = ExtResource("2_preset_library")
|
||||
@@ -329,7 +331,7 @@ presets = Array[ExtResource("3_c6jpa")]([SubResource("Resource_ajt3x"), SubResou
|
||||
|
||||
[node name="DayNightController" type="Node" parent="." unique_id=1083149574]
|
||||
script = ExtResource("3_day_night")
|
||||
time_of_day = 0.1482273141975634
|
||||
time_of_day = 0.31124353179020736
|
||||
current_day = 4
|
||||
sun_color_curve = SubResource("Gradient_sxvon")
|
||||
sun_intensity_curve = SubResource("Curve_fm80q")
|
||||
@@ -351,11 +353,11 @@ script = ExtResource("5_clouds")
|
||||
layer_configs = Array[ExtResource("4_ssi15")]([SubResource("Resource_xh4oc"), SubResource("Resource_ahi10"), SubResource("Resource_a5xai"), SubResource("Resource_uxs4q")])
|
||||
global_coverage = 0.2
|
||||
global_wind_speed = 0.5
|
||||
sun_direction = Vector3(0.6647294, -0.6939493, -0.2767116)
|
||||
sun_color = Color(1, 0.55136895, 0.3513689, 1)
|
||||
sun_intensity = 0.0
|
||||
moon_direction = Vector3(0.6799649, 0.7098545, 0.18372385)
|
||||
moon_intensity = 0.33406785
|
||||
sun_direction = Vector3(0.9166991, 0.37115902, 0.14799932)
|
||||
sun_color = Color(1, 0.62245756, 0.45919484, 1)
|
||||
sun_intensity = 0.80182046
|
||||
moon_direction = Vector3(0.9225648, -0.37353396, -0.09667771)
|
||||
moon_intensity = 0.0
|
||||
|
||||
[node name="PostProcessController" type="Node" parent="." unique_id=186747041]
|
||||
script = ExtResource("6_post_process")
|
||||
@@ -365,9 +367,11 @@ sky_top_color = Color(0.2, 0.4, 0.85, 1)
|
||||
sky_horizon_color = Color(0.6, 0.75, 0.95, 1)
|
||||
sky_bottom_color = Color(0.5, 0.6, 0.7, 1)
|
||||
skybox_texture = ExtResource("6_ssi15")
|
||||
fog_color = Color(0.1, 0.12, 0.2, 1)
|
||||
fog_density = 0.017602645
|
||||
sun_direction = Vector3(0.6647294, -0.6939493, -0.2767116)
|
||||
fog_color = Color(0.24694908, 0.27429652, 0.35919484, 1)
|
||||
fog_density = 0.014247157
|
||||
sun_glow_intensity = 0.40091023
|
||||
sun_glow_color = Color(1, 0.62245756, 0.45919484, 1)
|
||||
sun_direction = Vector3(0.9166991, 0.37115902, 0.14799932)
|
||||
|
||||
[node name="VFXController" type="Node3D" parent="." unique_id=207251300]
|
||||
script = ExtResource("7_vfx")
|
||||
@@ -382,13 +386,13 @@ environment = ExtResource("13_2w5ig")
|
||||
compositor = SubResource("Compositor_ssi15")
|
||||
|
||||
[node name="SunLight" type="DirectionalLight3D" parent="." unique_id=1278065589]
|
||||
transform = Transform3D(-0.38430893, -0.9231061, 0.0134779755, 0, 0.014599117, 0.99989367, -0.9232045, 0.384268, -0.0056105736, 0, 50, 0)
|
||||
visible = false
|
||||
light_color = Color(1, 0.55136895, 0.3513689, 1)
|
||||
light_energy = 0.0
|
||||
transform = Transform3D(0.15938424, -0.98704875, 0.018195797, 0, 0.018431408, 0.99983037, -0.9872164, -0.15935718, 0.0029376775, 0, 50, 0)
|
||||
light_color = Color(1, 0.62245756, 0.45919484, 1)
|
||||
light_energy = 0.80182046
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="MoonLight" type="DirectionalLight3D" parent="." unique_id=52072807]
|
||||
transform = Transform3D(0.2608423, -0.9652886, 0.013407094, 0, 0.013887873, 0.9999038, -0.9653814, -0.26081723, 0.003622545, 0, 50, 0)
|
||||
transform = Transform3D(-0.10422167, -0.99438065, 0.01858649, 0, 0.018688265, 0.9998256, -0.99455404, 0.1042035, -0.0019477225, 0, 50, 0)
|
||||
visible = false
|
||||
light_color = Color(0.7, 0.8, 1, 1)
|
||||
light_energy = 0.33406785
|
||||
light_energy = 0.0
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[node name="DynamicSkyToy" type="Node3D" unique_id=1968105337]
|
||||
|
||||
[node name="DynamicSky" parent="." unique_id=516593260 instance=ExtResource("1_cuadp")]
|
||||
show_debug_panel = true
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=805686804]
|
||||
|
||||
|
||||
@@ -110,16 +110,16 @@ shader_parameter/sky_bottom_color = Color(0.5, 0.6, 0.7, 1)
|
||||
shader_parameter/gradient_intensity = 1.0
|
||||
shader_parameter/horizon_blend = 0.5
|
||||
shader_parameter/sun_glow_enabled = true
|
||||
shader_parameter/sun_direction = Vector3(0.9079945, -0.38918287, -0.1551863)
|
||||
shader_parameter/sun_glow_color = Color(1, 0.5257787, 0.32577872, 1)
|
||||
shader_parameter/sun_glow_intensity = 0.0
|
||||
shader_parameter/sun_direction = Vector3(0.9166991, 0.37115902, 0.14799932)
|
||||
shader_parameter/sun_glow_color = Color(1, 0.62245756, 0.45919484, 1)
|
||||
shader_parameter/sun_glow_intensity = 0.40091023
|
||||
shader_parameter/sun_glow_size = 0.2
|
||||
shader_parameter/sun_glow_falloff = 2.0
|
||||
shader_parameter/dawn_dusk_enabled = true
|
||||
shader_parameter/dawn_dusk_color = Color(1, 0.6, 0.4, 1)
|
||||
shader_parameter/dawn_dusk_intensity = 0.5
|
||||
shader_parameter/dawn_dusk_blend = 0.0
|
||||
shader_parameter/stars_visibility = 0.80297995
|
||||
shader_parameter/stars_visibility = 0.0
|
||||
shader_parameter/stars_tint = Color(1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="Sky" id="Sky_ssi15"]
|
||||
@@ -128,9 +128,9 @@ sky_material = SubResource("ShaderMaterial_jmmec")
|
||||
[resource]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_ssi15")
|
||||
ambient_light_color = Color(0.15, 0.18, 0.3, 1)
|
||||
ambient_light_energy = 0.4504698
|
||||
ambient_light_color = Color(0.26021183, 0.2951101, 0.4102118, 1)
|
||||
ambient_light_energy = 0.5301137
|
||||
fog_enabled = true
|
||||
fog_light_color = Color(0.1, 0.12, 0.2, 1)
|
||||
fog_density = 0.015825503
|
||||
fog_light_color = Color(0.24694908, 0.27429652, 0.35919484, 1)
|
||||
fog_density = 0.014247157
|
||||
fog_height_density = 0.1
|
||||
|
||||
@@ -147,6 +147,9 @@ func _create_cloud_material(config: CloudLayerConfig) -> ShaderMaterial:
|
||||
|
||||
if config.texture:
|
||||
material.set_shader_parameter("cloud_texture", config.texture)
|
||||
else:
|
||||
var procedural_tex := ProceduralCloudTexture.create_default_cloud_texture(config.layer_type)
|
||||
material.set_shader_parameter("cloud_texture", procedural_tex)
|
||||
|
||||
return material
|
||||
|
||||
@@ -214,12 +217,13 @@ func _update_flow(delta: float) -> void:
|
||||
|
||||
var wind_dir := global_wind_direction if use_global_wind else config.flow_direction
|
||||
var wind_spd := global_wind_speed if use_global_wind else 1.0
|
||||
#var flow_offset: float = material.get_shader_parameter("flow_offset")
|
||||
#flow_offset += config.flow_speed * wind_spd * delta
|
||||
#
|
||||
#material.set_shader_parameter("flow_offset", flow_offset)
|
||||
#material.set_shader_parameter("flow_direction", wind_dir)
|
||||
#smaterial.set_shader_parameter("evolution_offset", _evolution_offset)
|
||||
var current_offset: Variant = material.get_shader_parameter("flow_offset")
|
||||
var flow_offset: float = current_offset if current_offset != null else 0.0
|
||||
flow_offset += config.flow_speed * wind_spd * delta
|
||||
|
||||
material.set_shader_parameter("flow_offset", flow_offset)
|
||||
material.set_shader_parameter("flow_direction", wind_dir)
|
||||
material.set_shader_parameter("evolution_offset", _evolution_offset)
|
||||
|
||||
|
||||
func _update_lighting() -> void:
|
||||
|
||||
@@ -41,7 +41,7 @@ func _ready() -> void:
|
||||
_ensure_controllers_exist()
|
||||
|
||||
_connect_signals()
|
||||
property_list_changed_notify()
|
||||
#property_list_changed_notify()
|
||||
_sync_preset_name()
|
||||
_apply_seed()
|
||||
_sync_all_systems()
|
||||
|
||||
@@ -12,6 +12,9 @@ signal weather_state_exited(state: WeatherProfile.WeatherState)
|
||||
@export var weather_profiles: Array[WeatherProfile] = []
|
||||
@export var current_weather: WeatherProfile.WeatherState = WeatherProfile.WeatherState.CLEAR:
|
||||
set(value):
|
||||
if _changing_weather:
|
||||
current_weather = value
|
||||
return
|
||||
if value != current_weather:
|
||||
_request_weather_change(value)
|
||||
|
||||
@@ -39,6 +42,7 @@ var _random_weather_timer: float = 0.0
|
||||
var _next_weather_change: float = 0.0
|
||||
var _timeline_index: int = 0
|
||||
var _timeline_timer: float = 0.0
|
||||
var _changing_weather: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -175,7 +179,9 @@ func set_weather(state: WeatherProfile.WeatherState, transition_duration: float
|
||||
weather_state_exited.emit(_current_profile.weather_state)
|
||||
|
||||
var old_state := current_weather
|
||||
_changing_weather = true
|
||||
current_weather = state
|
||||
_changing_weather = false
|
||||
_target_profile = profile
|
||||
|
||||
if transition_duration < 0:
|
||||
@@ -199,7 +205,9 @@ func set_weather_immediate(state: WeatherProfile.WeatherState) -> void:
|
||||
weather_state_exited.emit(_current_profile.weather_state)
|
||||
|
||||
var old_state := current_weather
|
||||
_changing_weather = true
|
||||
current_weather = state
|
||||
_changing_weather = false
|
||||
_current_profile = profile
|
||||
_target_profile = profile
|
||||
_is_transitioning = false
|
||||
|
||||
@@ -26,7 +26,7 @@ enum VolumeShape {
|
||||
|
||||
@export_group("Kill Behavior")
|
||||
@export var enabled: bool = true
|
||||
@export var priority: int = 0
|
||||
@export var kill_priority: int = 0
|
||||
@export var instant_kill: bool = true
|
||||
@export var fade_out_margin: float = 1.0
|
||||
@export var fade_out_duration: float = 0.3
|
||||
@@ -222,11 +222,11 @@ func is_point_in_fade_margin(point: Vector3) -> bool:
|
||||
var half_size := volume_size * 0.5
|
||||
var inner_half := half_size - Vector3(fade_out_margin, fade_out_margin, fade_out_margin)
|
||||
|
||||
var in_outer := abs(local_point.x) <= half_size.x and \
|
||||
var in_outer: bool = abs(local_point.x) <= half_size.x and \
|
||||
abs(local_point.y) <= half_size.y and \
|
||||
abs(local_point.z) <= half_size.z
|
||||
|
||||
var in_inner := abs(local_point.x) <= inner_half.x and \
|
||||
var in_inner: bool = abs(local_point.x) <= inner_half.x and \
|
||||
abs(local_point.y) <= inner_half.y and \
|
||||
abs(local_point.z) <= inner_half.z
|
||||
|
||||
@@ -240,8 +240,8 @@ func is_point_in_fade_margin(point: Vector3) -> bool:
|
||||
var horizontal_dist := Vector2(local_point.x, local_point.z).length()
|
||||
var half_height := volume_size.y * 0.5
|
||||
|
||||
var in_outer := horizontal_dist <= volume_radius and abs(local_point.y) <= half_height
|
||||
var in_inner := horizontal_dist <= volume_radius - fade_out_margin and \
|
||||
var in_outer: bool = horizontal_dist <= volume_radius and abs(local_point.y) <= half_height
|
||||
var in_inner: bool = horizontal_dist <= volume_radius - fade_out_margin and \
|
||||
abs(local_point.y) <= half_height - fade_out_margin
|
||||
|
||||
return in_outer and not in_inner
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
[gd_scene format=3 uid="uid://csm5ihvpyw5m7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cfjaa6hq1wpvd" path="res://scripts/main.gd" id="1_main"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_sgp6g"]
|
||||
bg_color = Color(0.97496897, 0.9929336, 1, 1)
|
||||
corner_radius_top_left = 16
|
||||
corner_radius_top_right = 16
|
||||
corner_radius_bottom_right = 16
|
||||
corner_radius_bottom_left = 16
|
||||
shadow_size = 3
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o5qli"]
|
||||
bg_color = Color(0.97496897, 0.9929336, 1, 1)
|
||||
corner_radius_top_left = 16
|
||||
corner_radius_top_right = 16
|
||||
corner_radius_bottom_right = 16
|
||||
corner_radius_bottom_left = 16
|
||||
shadow_size = 3
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0wfyh"]
|
||||
bg_color = Color(0.97496897, 0.9929336, 1, 1)
|
||||
corner_radius_top_left = 16
|
||||
corner_radius_top_right = 16
|
||||
corner_radius_bottom_right = 16
|
||||
corner_radius_bottom_left = 16
|
||||
shadow_size = 3
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_o5qli"]
|
||||
|
||||
[node name="Main" type="Control" unique_id=1436180697]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="Panel" type="Panel" parent="." unique_id=1434712397]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=616480461]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -150.5
|
||||
offset_top = -126.0
|
||||
offset_right = 150.5
|
||||
offset_bottom = 126.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="TrainJourney" type="Button" parent="VBoxContainer" unique_id=748071748]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_sgp6g")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_o5qli")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_0wfyh")
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_o5qli")
|
||||
text = "Train Journey"
|
||||
|
||||
[node name="TrainControl" type="Button" parent="VBoxContainer" unique_id=516792886]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_sgp6g")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_o5qli")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_0wfyh")
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_o5qli")
|
||||
text = "Train Control"
|
||||
|
||||
[node name="Exit" type="Button" parent="VBoxContainer" unique_id=1837330634]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
|
||||
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 30
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_sgp6g")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_o5qli")
|
||||
theme_override_styles/hover = SubResource("StyleBoxFlat_0wfyh")
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_o5qli")
|
||||
text = "Exit"
|
||||
|
||||
[node name="Label" type="Label" parent="." unique_id=1191738199]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -104.5
|
||||
offset_top = -224.0
|
||||
offset_right = 104.5
|
||||
offset_bottom = -157.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0)
|
||||
theme_override_font_sizes/font_size = 48
|
||||
text = "TRINITTU"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/TrainJourney" to="." method="_on_train_journey_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/TrainControl" to="." method="_on_train_control_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/Exit" to="." method="_on_exit_pressed"]
|
||||
10
scenes/test.tscn
Normal file
10
scenes/test.tscn
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_scene format=3 uid="uid://leuf8p24te7a"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://doiojb8xxlp2s" path="res://dynamic-sky/dynamic_sky.tscn" id="1_errlg"]
|
||||
|
||||
[node name="Node3D" type="Node3D" unique_id=973524329]
|
||||
|
||||
[node name="DynamicSky" parent="." unique_id=516593260 instance=ExtResource("1_errlg")]
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="." unique_id=2106785413]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 74.42207, 0)
|
||||
@@ -3,11 +3,10 @@
|
||||
[ext_resource type="Script" uid="uid://ckndmko4orxx" path="res://scripts/traincontrol.gd" id="1_amtmp"]
|
||||
[ext_resource type="Texture2D" uid="uid://bg24v3kb5e73l" path="res://resources/rail2.png" id="1_ihlg3"]
|
||||
[ext_resource type="PackedScene" uid="uid://csm5ihvpyw5m7" path="res://scenes/main.tscn" id="2_0b1nv"]
|
||||
[ext_resource type="Script" uid="uid://ck4j0pekoofm1" path="res://scripts/engine.gd" id="2_jgp6u"]
|
||||
[ext_resource type="ArrayMesh" uid="uid://cm8un80nubjbi" path="res://resources/train kit/train-diesel-a.obj" id="3_jy5c4"]
|
||||
[ext_resource type="Script" uid="uid://b65vwus8xxmun" path="res://scripts/traincontrol_camera.gd" id="4_jy5c4"]
|
||||
[ext_resource type="Script" uid="uid://df2oi5vyeak81" path="res://scripts/train_movement.gd" id="6_1lqs8"]
|
||||
[ext_resource type="Script" uid="uid://b5x80gpkn1swt" path="res://scripts/rail_swtich.gd" id="7_cenvf"]
|
||||
[ext_resource type="Script" uid="uid://b5x80gpkn1swt" path="res://scripts/rail_switch.gd" id="7_cenvf"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_23vqf"]
|
||||
size = Vector2(100, 100)
|
||||
@@ -123,9 +122,8 @@ path_joined = true
|
||||
material = SubResource("StandardMaterial3D_ihlg3")
|
||||
|
||||
[node name="TrainEngine" type="PathFollow3D" parent="Ground/Rails1" unique_id=973990755]
|
||||
transform = Transform3D(0.6867339, -0.014397825, -0.8973005, 0, 1.130071, -0.018126711, 0.8974141, 0.01101774, 0.68664694, -41.962486, 0.03566742, -44.78871)
|
||||
transform = Transform3D(0.6867339, -0.014397825, -0.8973007, 0, 1.130071, -0.018126717, 0.8974141, 0.01101774, 0.6866472, -41.962486, 0.03566742, -44.78871)
|
||||
rotation_mode = 4
|
||||
script = ExtResource("2_jgp6u")
|
||||
|
||||
[node name="Rails2" type="Path3D" parent="Ground" unique_id=1426938039]
|
||||
curve = SubResource("Curve3D_1lqs8")
|
||||
@@ -180,7 +178,6 @@ material = SubResource("StandardMaterial3D_ihlg3")
|
||||
[node name="TrainEngine" type="PathFollow3D" parent="Ground/Rails2" unique_id=1618605131]
|
||||
transform = Transform3D(-0.39616987, 0.010450672, -1.0582525, 0, 1.1301593, 0.01115706, 1.0583019, 0.003912155, -0.3961513, 24, 0, -36)
|
||||
rotation_mode = 4
|
||||
script = ExtResource("2_jgp6u")
|
||||
|
||||
[node name="Train" type="MeshInstance3D" parent="Ground" unique_id=65189673]
|
||||
transform = Transform3D(0.6867333, -0.014397784, -0.89729905, 0, 1.1300678, -0.018126683, 0.8974134, 0.011017708, 0.68664587, -41.962486, 0.03566742, -44.78871)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
[ext_resource type="Script" uid="uid://dfyo0h5yj3us8" path="res://scripts/trainjourney.gd" id="1_0nial"]
|
||||
[ext_resource type="PackedScene" uid="uid://csm5ihvpyw5m7" path="res://scenes/main.tscn" id="2_7fone"]
|
||||
[ext_resource type="Script" uid="uid://bymoo78gun6a4" path="res://scripts/track_generator.gd" id="2_j07ug"]
|
||||
[ext_resource type="PackedScene" uid="uid://doiojb8xxlp2s" path="res://dynamic-sky/dynamic_sky.tscn" id="3_7brvr"]
|
||||
[ext_resource type="PackedScene" uid="uid://cer3o7xlhju7v" path="res://scenes/train.tscn" id="3_7fone"]
|
||||
[ext_resource type="Script" uid="uid://cvn333pymsowx" path="res://scripts/train.gd" id="4_7brvr"]
|
||||
[ext_resource type="Script" uid="uid://cgy51h6a5syer" path="res://scripts/trainjourney_camera.gd" id="5_4toc1"]
|
||||
@@ -40,6 +41,9 @@ fog_density = 0.0015
|
||||
script = ExtResource("1_0nial")
|
||||
main_scene = ExtResource("2_7fone")
|
||||
|
||||
[node name="DynamicSky" parent="." unique_id=516593260 instance=ExtResource("3_7brvr")]
|
||||
show_debug_panel = true
|
||||
|
||||
[node name="TrackGenerator" type="Node3D" parent="." unique_id=1804102656]
|
||||
script = ExtResource("2_j07ug")
|
||||
track_width = 1.0
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
extends PathFollow3D
|
||||
#class_name TrainEngine
|
||||
#
|
||||
#@onready var train: MeshInstance3D = $"../../Train"
|
||||
#
|
||||
#
|
||||
#func _physics_process(delta: float) -> void:
|
||||
#if train:
|
||||
#progress += train.current_speed * delta
|
||||
@@ -1 +0,0 @@
|
||||
uid://ck4j0pekoofm1
|
||||
@@ -1,10 +1,10 @@
|
||||
extends Area3D
|
||||
class_name RailSwitch
|
||||
|
||||
@export var rail_a: Path3D
|
||||
@export var rail_b: Path3D
|
||||
@export var switch_to_rail: Path3D # Il binario verso cui deviare
|
||||
|
||||
|
||||
# Cambia direzione dello scambio
|
||||
func toggle_switch() -> void:
|
||||
if switch_to_rail == rail_a:
|
||||
@@ -12,6 +12,6 @@ func toggle_switch() -> void:
|
||||
else:
|
||||
switch_to_rail = rail_a
|
||||
|
||||
func _on_body_entered(body: Node3D) -> void:
|
||||
if body is Train:
|
||||
body.switch_to_rail(switch_to_rail)
|
||||
|
||||
func get_state_name() -> String:
|
||||
return "BINARIO 1" if switch_to_rail == rail_b else "BINARIO 2"
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://bhan6tvt4sow
|
||||
uid://b5x80gpkn1swt
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
extends Area3D
|
||||
|
||||
@export var rail_a: Path3D
|
||||
@export var rail_b: Path3D
|
||||
@export var switch_to_rail: Path3D # Il binario verso cui deviare
|
||||
|
||||
|
||||
# Cambia direzione dello scambio
|
||||
func toggle_switch() -> void:
|
||||
if switch_to_rail == rail_a:
|
||||
switch_to_rail = rail_b
|
||||
else:
|
||||
switch_to_rail = rail_a
|
||||
|
||||
|
||||
#func get_state_name() -> String:
|
||||
#return "BIANRIO 1" if current_state == SwitchState.LEFT else "BINARIO 2"
|
||||
@@ -1 +0,0 @@
|
||||
uid://b5x80gpkn1swt
|
||||
@@ -9,6 +9,10 @@ extends Node3D
|
||||
@onready var switch_label : Label = $HUD/switch_label
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_update_switch_status()
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
_update_ui()
|
||||
|
||||
@@ -31,17 +35,16 @@ func _update_ui() -> void:
|
||||
func _toggle_rail() -> void:
|
||||
if train and rail_switch:
|
||||
rail_switch.toggle_switch()
|
||||
train.switch_to_rail(rail_switch.switch_to_rail)
|
||||
#train.switch_to_rail(rail_switch.switch_to_rail)
|
||||
#_update_switch_status()
|
||||
|
||||
|
||||
func _update_switch_status():
|
||||
if not switch_label:
|
||||
return
|
||||
|
||||
#if rail_switch:
|
||||
#var state_name = rail_switch.get_state_name()
|
||||
#var color = Color.YELLOW if rail_switch.current_state == rail_switch.SwitchState.LEFT else Color.CYAN
|
||||
#switch_label.text = "Scambio: %s" % state_name
|
||||
#switch_label.add_theme_color_override("font_color", color)
|
||||
#else:
|
||||
#switch_label.text = "Scambio: N/A"
|
||||
if rail_switch:
|
||||
var state_name = rail_switch.get_state_name()
|
||||
switch_label.text = "Scambio: %s" % state_name
|
||||
else:
|
||||
switch_label.text = "Scambio: N/A"
|
||||
|
||||
Reference in New Issue
Block a user