Skip to content

Commit afd99e5

Browse files
Add Physics Tests project
1 parent 48eb973 commit afd99e5

33 files changed

+1384
-0
lines changed

3d/physics_tests/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 3D Physics Tests
2+
3+
This demo contains a series of tests for the 3D
4+
physics engine.
5+
6+
They can be used for different purpose:
7+
- Functional tests to check for regressions and
8+
compare the behavior between physics engines
9+
- Performance tests to evaluate and compare
10+
performance between physics engines
11+
12+
Language: GDScript
13+
14+
Renderer: GLES 2
15+
16+
## Screenshots
17+
18+
![Screenshot](screenshots/screenshot.png)
104 KB
Binary file not shown.

3d/physics_tests/assets/robot_head/godot3_robot_head_collision.tres

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- Robot Head model created by James Redmond (fracteed) 2018
2+
3+
- http://www.fracteed.com/godot.html
4+
5+
- created with Godot 3.0.5
6+
7+
- models created using Blender 2.79 and Sunstance Painter/Designer
8+
9+
- Creative Commons License CC-BY:
10+
"This license lets others distribute, remix, tweak, and build upon your work, even commercially, as long as they credit you for the original creation.
11+
This is the most accommodating of licenses offered. Recommended for maximum dissemination and use of licensed materials."

3d/physics_tests/default_env.tres

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[gd_resource type="Environment" format=2]
2+
3+
[resource]

3d/physics_tests/icon.png

7.2 KB
Loading

3d/physics_tests/icon.png.import

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://icon.png"
13+
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

3d/physics_tests/main.tscn

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
[gd_scene load_steps=10 format=2]
2+
3+
[ext_resource path="res://utils/label_fps.gd" type="Script" id=1]
4+
[ext_resource path="res://utils/label_version.gd" type="Script" id=2]
5+
[ext_resource path="res://utils/label_engine.gd" type="Script" id=3]
6+
[ext_resource path="res://tests_menu.gd" type="Script" id=4]
7+
[ext_resource path="res://utils/label_test.gd" type="Script" id=5]
8+
[ext_resource path="res://utils/container_log.gd" type="Script" id=10]
9+
[ext_resource path="res://utils/scroll_log.gd" type="Script" id=11]
10+
[ext_resource path="res://tests.gd" type="Script" id=12]
11+
12+
[sub_resource type="StyleBoxFlat" id=1]
13+
bg_color = Color( 0, 0, 0, 0.176471 )
14+
15+
[node name="Main" type="Control"]
16+
anchor_right = 1.0
17+
anchor_bottom = 1.0
18+
mouse_filter = 2
19+
script = ExtResource( 12 )
20+
__meta__ = {
21+
"_edit_use_anchors_": false
22+
}
23+
24+
[node name="TestsMenu" type="MenuButton" parent="."]
25+
margin_left = 10.0
26+
margin_top = 10.0
27+
margin_right = 125.0
28+
margin_bottom = 30.0
29+
text = "TESTS"
30+
flat = false
31+
script = ExtResource( 4 )
32+
__meta__ = {
33+
"_edit_use_anchors_": false
34+
}
35+
36+
[node name="LabelControls" type="Label" parent="."]
37+
margin_left = 157.0
38+
margin_top = 13.0
39+
margin_right = 375.0
40+
margin_bottom = 27.0
41+
text = "R - RESTART / D - TOGGLE COLLISION / F - TOGGLE FULL SCREEN / ESC - QUIT"
42+
__meta__ = {
43+
"_edit_use_anchors_": false
44+
}
45+
46+
[node name="LabelFPS" type="Label" parent="."]
47+
anchor_top = 1.0
48+
anchor_bottom = 1.0
49+
margin_left = 10.0
50+
margin_top = -19.0
51+
margin_right = 50.0
52+
margin_bottom = -5.0
53+
text = "FPS: 0"
54+
script = ExtResource( 1 )
55+
__meta__ = {
56+
"_edit_use_anchors_": false
57+
}
58+
59+
[node name="LabelEngine" type="Label" parent="."]
60+
anchor_top = 1.0
61+
anchor_bottom = 1.0
62+
margin_left = 10.0
63+
margin_top = -39.0
64+
margin_right = 50.0
65+
margin_bottom = -25.0
66+
text = "Physics engine:"
67+
script = ExtResource( 3 )
68+
__meta__ = {
69+
"_edit_use_anchors_": false
70+
}
71+
72+
[node name="LabelVersion" type="Label" parent="."]
73+
anchor_top = 1.0
74+
anchor_bottom = 1.0
75+
margin_left = 10.0
76+
margin_top = -59.0
77+
margin_right = 50.0
78+
margin_bottom = -45.0
79+
text = "Godot Version:"
80+
script = ExtResource( 2 )
81+
__meta__ = {
82+
"_edit_use_anchors_": false
83+
}
84+
85+
[node name="LabelTest" type="Label" parent="."]
86+
anchor_top = 1.0
87+
anchor_bottom = 1.0
88+
margin_left = 10.0
89+
margin_top = -79.0
90+
margin_right = 50.0
91+
margin_bottom = -65.0
92+
text = "Test:"
93+
script = ExtResource( 5 )
94+
__meta__ = {
95+
"_edit_use_anchors_": false
96+
}
97+
98+
[node name="PanelLog" type="Panel" parent="."]
99+
anchor_left = 1.0
100+
anchor_top = 1.0
101+
anchor_right = 1.0
102+
anchor_bottom = 1.0
103+
margin_left = -428.0
104+
margin_top = -125.0
105+
custom_styles/panel = SubResource( 1 )
106+
__meta__ = {
107+
"_edit_use_anchors_": false
108+
}
109+
110+
[node name="ButtonClear" type="Button" parent="PanelLog"]
111+
anchor_left = 1.0
112+
anchor_top = 1.0
113+
anchor_right = 1.0
114+
anchor_bottom = 1.0
115+
margin_left = -48.0
116+
margin_top = -25.0
117+
margin_right = -5.0
118+
margin_bottom = -5.0
119+
focus_mode = 0
120+
enabled_focus_mode = 0
121+
text = "clear"
122+
__meta__ = {
123+
"_edit_use_anchors_": false
124+
}
125+
126+
[node name="CheckBoxScroll" type="CheckBox" parent="PanelLog"]
127+
anchor_left = 1.0
128+
anchor_top = 1.0
129+
anchor_right = 1.0
130+
anchor_bottom = 1.0
131+
margin_left = -150.0
132+
margin_top = -27.0
133+
margin_right = -54.0
134+
margin_bottom = -3.0
135+
focus_mode = 0
136+
pressed = true
137+
enabled_focus_mode = 0
138+
text = "auto-scroll"
139+
__meta__ = {
140+
"_edit_use_anchors_": false
141+
}
142+
143+
[node name="ScrollLog" type="ScrollContainer" parent="PanelLog"]
144+
margin_left = 10.0
145+
margin_top = 5.0
146+
margin_right = 418.0
147+
margin_bottom = 94.0
148+
scroll_horizontal_enabled = false
149+
script = ExtResource( 11 )
150+
__meta__ = {
151+
"_edit_use_anchors_": false
152+
}
153+
auto_scroll = true
154+
155+
[node name="VBoxLog" type="VBoxContainer" parent="PanelLog/ScrollLog"]
156+
margin_right = 408.0
157+
margin_bottom = 89.0
158+
size_flags_horizontal = 3
159+
size_flags_vertical = 3
160+
alignment = 2
161+
script = ExtResource( 10 )
162+
163+
[node name="LabelLog" type="Label" parent="PanelLog/ScrollLog/VBoxLog"]
164+
margin_top = 75.0
165+
margin_right = 408.0
166+
margin_bottom = 89.0
167+
text = "Log start"
168+
valign = 2
169+
max_lines_visible = 5
170+
__meta__ = {
171+
"_edit_use_anchors_": false
172+
}
173+
[connection signal="pressed" from="PanelLog/ButtonClear" to="PanelLog/ScrollLog/VBoxLog" method="clear"]
174+
[connection signal="toggled" from="PanelLog/CheckBoxScroll" to="PanelLog/ScrollLog" method="set_auto_scroll"]

3d/physics_tests/project.godot

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
; Engine configuration file.
2+
; It's best edited using the editor UI and not directly,
3+
; since the parameters that go here are not all obvious.
4+
;
5+
; Format:
6+
; [section] ; section goes between []
7+
; param=value ; assign values to parameters
8+
9+
config_version=4
10+
11+
_global_script_classes=[ {
12+
"base": "MenuButton",
13+
"class": "OptionMenu",
14+
"language": "GDScript",
15+
"path": "res://utils/option_menu.gd"
16+
}, {
17+
"base": "Node",
18+
"class": "Test",
19+
"language": "GDScript",
20+
"path": "res://test.gd"
21+
} ]
22+
_global_script_class_icons={
23+
"OptionMenu": "",
24+
"Test": ""
25+
}
26+
27+
[application]
28+
29+
config/name="Physics Tests"
30+
run/main_scene="res://main.tscn"
31+
config/icon="res://icon.png"
32+
33+
[autoload]
34+
35+
Log="*res://utils/system_log.gd"
36+
System="*res://utils/system.gd"
37+
38+
[debug]
39+
40+
gdscript/warnings/return_value_discarded=false
41+
42+
[input]
43+
44+
toggle_full_screen={
45+
"deadzone": 0.5,
46+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":70,"unicode":0,"echo":false,"script":null)
47+
]
48+
}
49+
exit={
50+
"deadzone": 0.5,
51+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null)
52+
]
53+
}
54+
toggle_debug_collision={
55+
"deadzone": 0.5,
56+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
57+
]
58+
}
59+
restart_test={
60+
"deadzone": 0.5,
61+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":82,"unicode":0,"echo":false,"script":null)
62+
]
63+
}
64+
65+
[rendering]
66+
67+
quality/driver/driver_name="GLES2"
68+
environment/default_environment="res://default_env.tres"

3d/physics_tests/screenshots/.gdignore

Whitespace-only changes.

0 commit comments

Comments
 (0)