diff --git a/scenes/MainScene.tscn b/scenes/MainScene.tscn index b818221..cfb06e6 100644 --- a/scenes/MainScene.tscn +++ b/scenes/MainScene.tscn @@ -100,10 +100,7 @@ mesh = SubResource("CylinderMesh_ygjfp") [node name="Pointer" type="Sprite3D" parent="TabContainer/Planet/VBoxContainer/SubViewportContainer/SubViewport/ZaWarudo/Icosphere" unique_id=1498529325] unique_name_in_owner = true modulate = Color(1, 0, 0, 1) -pixel_size = 0.0018184 billboard = 1 -no_depth_test = true -fixed_size = true texture = ExtResource("5_ygjfp") [node name="Yaw" type="Node3D" parent="TabContainer/Planet/VBoxContainer/SubViewportContainer/SubViewport/ZaWarudo" unique_id=2073443785] @@ -137,8 +134,7 @@ horizontal_alignment = 1 [node name="SunAngle" type="HSlider" parent="TabContainer/Planet/VBoxContainer/MarginContainer/VBoxContainer" unique_id=1452623828] unique_name_in_owner = true layout_mode = 2 -max_value = 365.0 -tick_count = 14 +max_value = 360.0 [node name="HSeparator" type="HSeparator" parent="TabContainer/Planet/VBoxContainer/MarginContainer/VBoxContainer" unique_id=1053749080] layout_mode = 2 @@ -151,9 +147,7 @@ horizontal_alignment = 1 [node name="PlanetAngle" type="HSlider" parent="TabContainer/Planet/VBoxContainer/MarginContainer/VBoxContainer" unique_id=1574475714] unique_name_in_owner = true layout_mode = 2 -max_value = 24.0 -step = 0.25 -tick_count = 3 +max_value = 360.0 [node name="PanelContainer" type="PanelContainer" parent="TabContainer/Planet" unique_id=716838825] layout_mode = 2 @@ -227,26 +221,6 @@ max_length = 5 [node name="HSeparator" type="HSeparator" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer" unique_id=1862016318] layout_mode = 2 -[node name="Label4" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer" unique_id=1664133820] -layout_mode = 2 -text = "- World -" - -[node name="HBoxContainer5" type="HBoxContainer" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer" unique_id=703726989] -layout_mode = 2 - -[node name="Margin" type="VSeparator" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer/HBoxContainer5" unique_id=554179765] -layout_mode = 2 - -[node name="Label" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer/HBoxContainer5" unique_id=416863531] -layout_mode = 2 -theme_override_colors/font_color = Color(0.4922884, 0.49228835, 0.49228835, 1) -text = "Date: " - -[node name="Date" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer/HBoxContainer5" unique_id=716565176] -unique_name_in_owner = true -layout_mode = 2 -text = "-1" - [node name="Label2" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer" unique_id=186838891] layout_mode = 2 text = "- Point -" @@ -280,19 +254,6 @@ unique_name_in_owner = true layout_mode = 2 text = "-1" -[node name="VSeparator2" type="VSeparator" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer/HBoxContainer2" unique_id=521477767] -layout_mode = 2 - -[node name="Label2" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer/HBoxContainer2" unique_id=837979077] -layout_mode = 2 -theme_override_colors/font_color = Color(0.4922884, 0.49228835, 0.49228835, 1) -text = "Local Time:" - -[node name="LocalTime" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer/HBoxContainer2" unique_id=501459011] -unique_name_in_owner = true -layout_mode = 2 -text = "-1" - [node name="Label3" type="Label" parent="TabContainer/Planet/PanelContainer/MarginContainer/VBoxContainer2/VBoxContainer" unique_id=1412781677] layout_mode = 2 text = " - Plate -" diff --git a/src/Main.cs b/src/Main.cs index 59ce51e..2f58cc4 100644 --- a/src/Main.cs +++ b/src/Main.cs @@ -38,7 +38,6 @@ public partial class Main : Control UpdateStats(); Projector.GatherPoints(_planetHelper, int.Parse(GetNode("%Resolution").Text)); AxialTiltChanged(GetNode("%AxialTilt").Text); - UpdateTime(); } Vector3 _pointerPosition = Vector3.Zero; @@ -113,7 +112,6 @@ public partial class Main : Control vertexPos *= _meshInstance.Transform.Basis.Inverse().Orthonormalized(); _pointerPosition = (Vector3)vertexPos + (vertexPos * (_vertex.Height + 0.01f) * 0.03f); // vertexPos * 1.01f; GetNode("%Pointer").GlobalPosition = _pointerPosition; - UpdateTime(); } } @@ -130,65 +128,16 @@ public partial class Main : Control _planetHelper.Process(); if (_sunRotating) { - _sunRotation = (double)(GetNode("%SunAngle").Value / 365.0); GetNode("%Sun").Rotation -= GetNode("%Sun").Rotation; - GetNode("%Sun").Rotation += new Vector3(0, Mathf.DegToRad((float)_sunRotation * 360f), 0); - UpdateTime(); + GetNode("%Sun").Rotation += new Vector3(0, (float)Mathf.DegToRad(GetNode("%SunAngle").Value), 0); } if (_planetRotating) { - _planetRotation = (double)(GetNode("%PlanetAngle").Value / 24.0); _meshInstance.Rotation = Vector3.Zero; - _meshInstance.RotateY((float)Mathf.DegToRad(_planetRotation * 360.0)); + _meshInstance.RotateY((float)Mathf.DegToRad(GetNode("%PlanetAngle").Value)); _meshInstance.RotateZ(Mathf.DegToRad(_axialTilt)); - UpdateTime(); } } - - public void UpdateTime() - { - double hours = GetLocalTime(GetNode("%Pointer").GlobalPosition, GetNode("%Sun").GlobalTransform.Basis.Z, - _meshInstance); - GetNode