-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tscn
225 lines (174 loc) · 8.29 KB
/
main.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
[gd_scene load_steps=9 format=2]
[ext_resource path="res://rov23/rov23.tscn" type="PackedScene" id=1]
[ext_resource path="res://main.gd" type="Script" id=2]
[ext_resource path="res://missions/waypoint.tscn" type="PackedScene" id=3]
[ext_resource path="res://pool2023_new/pool2023_new.tscn" type="PackedScene" id=21]
[ext_resource path="res://pool2023/2023_MATE_Pool.tscn" type="PackedScene" id=23]
[ext_resource path="res://pool2023_4m/2023_MATE_Pool_4m.tscn" type="PackedScene" id=25]
[sub_resource type="Shader" id=3]
code = "/////////////////////////////////
// 2D Radial Distortion Shader //
/////////////////////////////////
// FROM: https://godotshaders.com/shader/2d-radial-distortion-fisheye-barrel/
// Screen space shader for Godot, based on: https://gist.github.com/aggregate1166877/a889083801d67917c26c12a98e7f57a7
shader_type canvas_item;
uniform float aspect = 1.0;
uniform float distortion = 1.0;
uniform float radius = 1.0;
uniform float alpha = 1.0;
uniform float crop = 1.0;
uniform vec4 crop_color : hint_color = vec4(0,0,0,1);
vec2 distort(vec2 p)
{
float d = length(p);
float z = sqrt(distortion + d * d * -distortion);
float r = atan(d, z) / 3.1415926535;
float phi = atan(p.y, p.x);
return vec2(r * cos(phi) * (1.0 / aspect) + 0.5, r * sin(phi) + 0.5);
}
void fragment()
{
vec2 xy = (SCREEN_UV * 2.0 - 1.0); // move origin of UV coordinates to center of screen
xy = vec2(xy.x * aspect, xy.y); // adjust aspect ratio
float d = length(xy); // distance from center
vec4 tex;
if (d < radius)
{
xy = distort(xy);
tex = texture(SCREEN_TEXTURE, xy);
COLOR = tex;
COLOR.a = alpha;
}
// radial crop
if (d > crop)
{
COLOR = crop_color;
}
}"
[sub_resource type="ShaderMaterial" id=4]
shader = SubResource( 3 )
shader_param/aspect = 1.0
shader_param/distortion = 1.5
shader_param/radius = 1.0
shader_param/alpha = 1.0
shader_param/crop = 1.0
shader_param/crop_color = Color( 0, 0, 0, 1 )
[node name="Main" type="Spatial"]
script = ExtResource( 2 )
[node name="OverviewCamera" type="Camera" parent="."]
transform = Transform( -0.478018, -0.63824, 0.603448, 0, 0.687024, 0.726635, -0.87835, 0.347344, -0.32841, 3.435, 2.032, -3.349 )
current = true
[node name="ViewportContainer" type="ViewportContainer" parent="."]
margin_top = -80.0
margin_right = 1280.0
margin_bottom = 1200.0
rect_scale = Vector2( 0.5, 0.5 )
mouse_filter = 2
stretch = true
[node name="Viewport" type="Viewport" parent="ViewportContainer"]
size = Vector2( 1280, 1280 )
handle_input_locally = false
render_target_update_mode = 3
[node name="ViewportContainerForward" type="ViewportContainer" parent="ViewportContainer/Viewport"]
margin_right = 640.0
margin_bottom = 480.0
mouse_filter = 2
[node name="Viewport" type="Viewport" parent="ViewportContainer/Viewport/ViewportContainerForward"]
size = Vector2( 1280, 1280 )
handle_input_locally = false
render_target_update_mode = 3
[node name="CameraForward" type="Camera" parent="ViewportContainer/Viewport/ViewportContainerForward/Viewport"]
transform = Transform( -0.0640621, 0, 0.997946, 0.282764, 0.959018, 0.0181517, -0.957048, 0.283346, -0.0614367, -0.0672728, -0.356254, -3.74767 )
fov = 113.1
near = 0.01
[node name="ColorRect" type="ColorRect" parent="ViewportContainer/Viewport"]
material = SubResource( 4 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 40.0
margin_bottom = 40.0
mouse_filter = 2
[node name="ViewportContainerForward2" type="ViewportContainer" parent="."]
margin_left = 640.0
margin_right = 1285.0
margin_bottom = 479.0
mouse_filter = 2
[node name="Viewport" type="Viewport" parent="ViewportContainerForward2"]
size = Vector2( 640, 480 )
handle_input_locally = false
render_target_update_mode = 3
[node name="CameraDownward" type="Camera" parent="ViewportContainerForward2/Viewport"]
transform = Transform( -0.064062, -0.997946, -4.92221e-08, 0.282764, -0.0181517, 0.959018, -0.957048, 0.0614366, 0.283346, -0.0520822, -0.40436, -3.7629 )
fov = 60.0
near = 0.01
[node name="ROV23" parent="." instance=ExtResource( 1 )]
transform = Transform( 0.0414572, 0, -0.99914, -0.31847, 0.947841, -0.0132142, 0.947026, 0.318744, 0.0392948, -0.00488129, -0.209336, -3.6201 )
forward_camera_location_path = NodePath("../ViewportContainer/Viewport/ViewportContainerForward/Viewport/CameraForward")
downward_camera_location_path = NodePath("../ViewportContainerForward2/Viewport/CameraDownward")
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.965926, 0, -0.258819, 0.25, -0.258819, 0.933013, -0.0669873, -0.965926, -0.25, 0, 0, 0 )
visible = false
light_energy = 0.2
shadow_enabled = true
shadow_bias = 0.01
directional_shadow_depth_range = 1
[node name="2023_MATE_Pool_4m" parent="." instance=ExtResource( 25 )]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.385733, -4.20738, 0 )
visible = false
[node name="2023_MATE_Pool" parent="." instance=ExtResource( 23 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.385733, -2.16791, 0 )
visible = false
[node name="pool2023_new" parent="." instance=ExtResource( 21 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.60679 )
[node name="CommandPanelContainer" type="PanelContainer" parent="."]
margin_right = 14.0
margin_bottom = 14.0
[node name="CommandGridContainer" type="GridContainer" parent="CommandPanelContainer"]
margin_left = 7.0
margin_top = 7.0
margin_right = 187.0
margin_bottom = 27.0
columns = 2
[node name="ControllerLabel" type="Label" parent="CommandPanelContainer/CommandGridContainer"]
margin_top = 3.0
margin_right = 67.0
margin_bottom = 17.0
text = "Controller:"
[node name="ControllerOptionButton" type="OptionButton" parent="CommandPanelContainer/CommandGridContainer"]
unique_name_in_owner = true
margin_left = 71.0
margin_right = 180.0
margin_bottom = 20.0
text = "0_manual.gd"
[node name="Waypoints" type="Spatial" parent="."]
[node name="Overlook" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, -0.221521, -0.575943, -3.48251 )
[node name="TopLine" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.26052, -0.598464, -1.45609 )
[node name="MidLine" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.26052, -2.07365, -1.45609 )
[node name="BottomLine" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.26052, -2.956, -1.45609 )
[node name="Fish1" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.473, -3.789, -0.575 )
[node name="Fish2" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.473, -3.789, -0.575 )
[node name="FishUp" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0.472613, -3.24627, -0.594734 )
[node name="TransectStart" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.46185, -3.42425, -3.07298 )
[node name="TransectMid1" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0.53692, -3.42425, -3.07298 )
[node name="TransectMid2" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.488367, -3.42425, -3.07298 )
[node name="TransectEnd" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -1.51519, -3.42425, -3.07298 )
[node name="ParkStart" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.08572, -3.63577, -1.68727 )
[node name="ParkIn" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.086, -3.636, -0.179789 )
[node name="ParkOut" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.08572, -3.63577, -1.6835 )
[node name="Return" parent="Waypoints" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -0.0147112, -0.31577, -3.66817 )
[connection signal="item_selected" from="CommandPanelContainer/CommandGridContainer/ControllerOptionButton" to="." method="_on_ControllerOptionButton_item_selected"]