Files
godot-demo-projects/2d/physics_tests/main.tscn

312 lines
9.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[gd_scene load_steps=15 format=3 uid="uid://duuq3oa8yi6yi"]
[ext_resource type="Script" uid="uid://dubik1f5fneps" path="res://utils/label_fps.gd" id="1"]
[ext_resource type="Script" uid="uid://ca4gk4ef7jc6f" path="res://utils/label_version.gd" id="2"]
[ext_resource type="Script" uid="uid://5f3c0mr1irl8" path="res://utils/label_engine.gd" id="3"]
[ext_resource type="Script" uid="uid://cfs8ay2xabc1j" path="res://tests_menu.gd" id="4"]
[ext_resource type="Script" uid="uid://bddc5b3tojfxc" path="res://utils/label_test.gd" id="5"]
[ext_resource type="Script" uid="uid://df276frwk3fje" path="res://utils/label_pause.gd" id="6"]
[ext_resource type="Script" uid="uid://cg23ktlqpvfgx" path="res://utils/ticks_per_second.gd" id="8_dg77c"]
[ext_resource type="Script" uid="uid://d12wj88dgcvd4" path="res://utils/time_scale.gd" id="9_ycdy4"]
[ext_resource type="Script" uid="uid://t6xab6he1cp6" path="res://utils/container_log.gd" id="10"]
[ext_resource type="Script" uid="uid://cyx64fbvm7bw0" path="res://utils/max_steps_per_frame.gd" id="10_w48qg"]
[ext_resource type="Script" uid="uid://bg74ptn4ol2g8" path="res://utils/scroll_log.gd" id="11"]
[ext_resource type="Script" uid="uid://c805rm8ds7mo3" path="res://utils/physics_interpolation.gd" id="11_ycdy4"]
[ext_resource type="Script" uid="uid://bce1220nuv7w0" path="res://tests.gd" id="12"]
[sub_resource type="StyleBoxFlat" id="1"]
bg_color = Color(0, 0, 0, 0.176471)
[node name="Main" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("12")
[node name="TestsMenu" type="MenuButton" parent="."]
layout_mode = 0
offset_left = 10.0
offset_top = 10.0
offset_right = 125.0
offset_bottom = 30.0
text = "Tests"
flat = false
script = ExtResource("4")
[node name="LabelControls" type="Label" parent="."]
layout_mode = 0
offset_left = 157.0
offset_top = 13.0
offset_right = 646.0
offset_bottom = 27.0
theme_override_constants/outline_size = 4
text = "P: Toggle Pause | R: Restart | C: Toggle Collision | F: Toggle Fullscreen | ESC: Quit"
[node name="LabelFPS" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = -36.0
offset_right = 55.0
offset_bottom = -13.0
grow_vertical = 0
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "FPS: 0"
script = ExtResource("1")
[node name="LabelEngine" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = -64.0
offset_right = 128.0
offset_bottom = -41.0
grow_vertical = 0
theme_override_colors/font_color = Color(1, 1, 1, 0.752941)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "Physics engine:"
script = ExtResource("3")
[node name="LabelVersion" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = -92.0
offset_right = 125.0
offset_bottom = -69.0
grow_vertical = 0
theme_override_colors/font_color = Color(1, 1, 1, 0.752941)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "Godot version:"
script = ExtResource("2")
[node name="LabelTest" type="Label" parent="."]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = -120.0
offset_right = 50.0
offset_bottom = -97.0
grow_vertical = 0
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "Test:"
script = ExtResource("5")
[node name="LabelPause" type="Label" parent="."]
modulate = Color(1, 1, 0, 1)
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -62.0
offset_top = 48.0
offset_right = 62.0
offset_bottom = 96.0
grow_horizontal = 2
theme_override_constants/outline_size = 6
theme_override_font_sizes/font_size = 24
text = "Paused"
script = ExtResource("6")
[node name="Options" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -392.0
offset_top = 56.0
offset_right = -16.0
offset_bottom = 168.0
grow_horizontal = 0
theme_override_constants/separation = 6
[node name="TicksPerSecond" type="HBoxContainer" parent="Options"]
layout_mode = 2
tooltip_text = "Higher values make physics more precise at the cost of higher CPU utilization.
Low values may result in objects phasing through each other (tunneling).
Physics ticks per second are automatically multiplied by Time Scale in this project."
theme_override_constants/separation = 10
script = ExtResource("8_dg77c")
[node name="Label" type="Label" parent="Options/TicksPerSecond"]
custom_minimum_size = Vector2(164, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "Ticks per Second"
[node name="HSlider" type="HSlider" parent="Options/TicksPerSecond"]
custom_minimum_size = Vector2(160, 0)
layout_mode = 2
size_flags_vertical = 4
min_value = 10.0
max_value = 240.0
step = 10.0
value = 60.0
[node name="Value" type="Label" parent="Options/TicksPerSecond"]
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "60"
[node name="TimeScale" type="HBoxContainer" parent="Options"]
layout_mode = 2
tooltip_text = "Game speed multiplier. Physics ticks per second are
automatically multiplied by Time Scale in this project
to ensure accurate simulation regardless of time scale."
theme_override_constants/separation = 10
script = ExtResource("9_ycdy4")
[node name="Label" type="Label" parent="Options/TimeScale"]
custom_minimum_size = Vector2(164, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "Time Scale"
[node name="HSlider" type="HSlider" parent="Options/TimeScale"]
custom_minimum_size = Vector2(160, 0)
layout_mode = 2
size_flags_vertical = 4
max_value = 5.0
step = 0.5
value = 0.5
[node name="Value" type="Label" parent="Options/TimeScale"]
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "1.0×"
[node name="MaxStepsPerFrame" type="HBoxContainer" parent="Options"]
layout_mode = 2
tooltip_text = "Physics will slow down if more physics steps
than this value need to be simulated in a
single rendered frame."
theme_override_constants/separation = 10
script = ExtResource("10_w48qg")
[node name="Label" type="Label" parent="Options/MaxStepsPerFrame"]
custom_minimum_size = Vector2(164, 0)
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "Max Steps per Frame"
[node name="HSlider" type="HSlider" parent="Options/MaxStepsPerFrame"]
custom_minimum_size = Vector2(160, 0)
layout_mode = 2
size_flags_vertical = 4
min_value = 1.0
max_value = 20.0
value = 8.0
[node name="Value" type="Label" parent="Options/MaxStepsPerFrame"]
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 4
text = "8"
[node name="PhysicsInterpolation" type="CheckButton" parent="Options"]
custom_minimum_size = Vector2(217, 0)
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "Smooths out rendering regardless of the physics tick rate.
This is a purely visual effect and has no impact on the physics simulation."
theme_override_constants/outline_size = 4
button_pressed = true
text = "Physics Interpolation"
script = ExtResource("11_ycdy4")
[node name="PanelLog" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -630.0
offset_top = -251.0
grow_horizontal = 0
grow_vertical = 0
mouse_filter = 1
theme_override_styles/panel = SubResource("1")
[node name="ButtonClear" type="Button" parent="PanelLog"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -65.0
offset_top = -36.0
offset_right = -5.0
offset_bottom = -5.0
grow_horizontal = 0
grow_vertical = 0
focus_mode = 0
text = "Clear"
[node name="CheckBoxScroll" type="CheckButton" parent="PanelLog"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -269.0
offset_top = -35.0
offset_right = -70.0
offset_bottom = -4.0
grow_horizontal = 0
grow_vertical = 0
focus_mode = 0
button_pressed = true
text = "Automatic Scrolling"
[node name="ScrollLog" type="ScrollContainer" parent="PanelLog"]
layout_mode = 0
offset_left = 10.0
offset_top = 5.0
offset_right = 619.0
offset_bottom = 210.0
script = ExtResource("11")
auto_scroll = true
[node name="VBoxLog" type="VBoxContainer" parent="PanelLog/ScrollLog"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 2
script = ExtResource("10")
[node name="LabelLog" type="Label" parent="PanelLog/ScrollLog/VBoxLog"]
layout_mode = 2
text = "Log start"
max_lines_visible = 5
[connection signal="value_changed" from="Options/TicksPerSecond/HSlider" to="Options/TicksPerSecond" method="_on_h_slider_value_changed"]
[connection signal="value_changed" from="Options/TimeScale/HSlider" to="Options/TimeScale" method="_on_h_slider_value_changed"]
[connection signal="value_changed" from="Options/MaxStepsPerFrame/HSlider" to="Options/MaxStepsPerFrame" method="_on_h_slider_value_changed"]
[connection signal="toggled" from="Options/PhysicsInterpolation" to="Options/PhysicsInterpolation" method="_on_check_button_toggled"]
[connection signal="pressed" from="PanelLog/ButtonClear" to="PanelLog/ScrollLog/VBoxLog" method="clear"]
[connection signal="toggled" from="PanelLog/CheckBoxScroll" to="PanelLog/ScrollLog" method="_on_check_box_scroll_toggled"]