Skip to content

Commit

Permalink
Merge pull request #77 from godotengine/quaternion_projection
Browse files Browse the repository at this point in the history
Fix quaternion after recent changes and add projection arguments to check
  • Loading branch information
qarmin authored Nov 3, 2022
2 parents a76b39a + 3106f5f commit bab196a
Show file tree
Hide file tree
Showing 22 changed files with 49 additions and 701 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/linux_builds_swiftshader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
vulkan-normal:
runs-on: "ubuntu-20.04"
name: Editor and exported project with sanitizers (target=debug/release, tools=yes/no, debug_symbols=yes, use_ubsan=yes, use_asan=yes)
name: Editor and exported project with sanitizers (target=debug, dev_build=yes, use_ubsan=yes, use_asan=yes)

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Compile Godot
run: |
cd godot
scons p=linuxbsd -j2 use_asan=yes use_ubsan=yes CCFLAGS="-fsanitize=shift,shift-exponent,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr"
cp bin/godot.linuxbsd.tools.x86_64.san ../
scons -j2 dev_build=yes target=editor use_asan=yes use_ubsan=yes linker=gold
cp bin/godot.linuxbsd.editor.dev.x86_64.san ../
cd ../
rm -rf godot
Expand All @@ -48,14 +48,14 @@ jobs:
- name: Open Editor
run: |
VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ./godot.linuxbsd.tools.x86_64.san --audio-driver Dummy -e --quit --path $(pwd) 2>&1 | tee sanitizers_log.txt || true
VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ./godot.linuxbsd.editor.dev.x86_64.san --audio-driver Dummy -e --quit --path $(pwd) 2>&1 | tee sanitizers_log.txt || true
misc/check_ci_log.py sanitizers_log.txt
- name: Run Project
run: |
VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ./godot.linuxbsd.tools.x86_64.san 180 --audio-driver Dummy --path $(pwd) 2>&1 | tee sanitizers_log.txt || true
VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run ./godot.linuxbsd.editor.dev.x86_64.san 180 --audio-driver Dummy --path $(pwd) 2>&1 | tee sanitizers_log.txt || true
misc/check_ci_log.py sanitizers_log.txt
- name: Run Project GLES3
run: |
DRI_PRIME=0 xvfb-run ./godot.linuxbsd.tools.x86_64.san 180 --rendering-driver opengl3 --audio-driver Dummy --path $(pwd) 2>&1 | tee sanitizers_log.txt || true
DRI_PRIME=0 xvfb-run ./godot.linuxbsd.editor.dev.x86_64.san 180 --rendering-driver opengl3 --audio-driver Dummy --path $(pwd) 2>&1 | tee sanitizers_log.txt || true
2 changes: 0 additions & 2 deletions Autoload/Autoload.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ var can_be_closed: bool = true
const alone_steps: Array = [
"res://CreatingAllThings/CreatingAllThings.tscn",
"res://Nodes/Nodes.tscn",
"res://Physics/2D/Physics2D.tscn",
"res://Physics/3D/Physics3D.tscn",
"res://AutomaticBugs/FunctionExecutor.tscn", # Only need to run once
]

Expand Down
15 changes: 10 additions & 5 deletions AutomaticBugs/BasicData.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var function_exceptions: Array = [
###
### Godot 4.0
###
"get_spawnable_scene", # 61390
"get_spawnable_scene", # 61390
"set_visibility_range_begin_margin", #54655
"set_visibility_range_begin", #54655
"_broadcast", #53873
Expand All @@ -34,7 +34,7 @@ var function_exceptions: Array = [
"set_is_setup", # Just don't use, in SkeletonModification crashes
"_update_shape", # TODO, probably crashes exported build
"get_custom_monitor", # TODO crashes only in exported build
"to_node", # 64977 - expected, because create completelly new object
"to_node", # 64977 - expected, because create completelly new object
###
### Input crashes, still are some problems TODO
###
Expand Down Expand Up @@ -201,8 +201,8 @@ var disabled_classes: Array = [
###
### Crashes, Freezes
###
"NavigationMeshGenerator", # Singleton
"AppProtocol", # AppProtocol singleton was recreated by script, should not instance it.
"NavigationMeshGenerator", # Singleton
"AppProtocol", # AppProtocol singleton was recreated by script, should not instance it.
"ProjectSettings", # Don't mess with project settings, because they can broke entire your workflow
"EditorSettings", # Also don't mess with editor settings
"GDScript", # Broke script
Expand Down Expand Up @@ -266,7 +266,6 @@ func check_if_is_allowed(method_data: Dictionary) -> bool:
# In case of adding new type, this prevents from crashing due not recognizing this type
# In case of removing/rename type, just comment e.g. TYPE_ARRAY and all occurencies on e.g. switch statement with it
var t: int = arg["type"]
print(t + " #############################################")
if !(
t == TYPE_NIL
|| t == TYPE_CALLABLE
Expand Down Expand Up @@ -305,6 +304,7 @@ func check_if_is_allowed(method_data: Dictionary) -> bool:
|| t == TYPE_PACKED_VECTOR3_ARRAY
|| t == TYPE_VECTOR4
|| t == TYPE_VECTOR4I
|| t == TYPE_PROJECTION
):
print("----------------------------------------------------------- TODO - MISSING TYPE, ADD SUPPORT IT") # Add assert here to get info which type is missing
return false
Expand Down Expand Up @@ -337,6 +337,11 @@ func get_list_of_available_classes(must_be_instantable: bool = true) -> Array:
var classes: Array = []
full_class_list.sort()
var c = 0

var singletons = Array(Engine.get_singleton_list())
for i in singletons:
disabled_classes.append(i)

for name_of_class in full_class_list:
if name_of_class in disabled_classes:
continue
Expand Down
12 changes: 12 additions & 0 deletions AutomaticBugs/ParseArgumentType.gd
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ func parse_and_return_objects(method_data: Dictionary, name_of_class: String, de
arguments_array.push_back(ValueCreator.get_vector4())
elif type == TYPE_VECTOR4I:
arguments_array.push_back(ValueCreator.get_vector4i())
elif type == TYPE_PROJECTION:
arguments_array.push_back(ValueCreator.get_projection())
else:
assert(false) # Missed some types, add it

Expand Down Expand Up @@ -321,6 +323,16 @@ func return_gdscript_code_which_run_this_object(data) -> String:
return_string += ", "
return_string += return_gdscript_code_which_run_this_object(data.w)
return_string += ")"
elif type == TYPE_PROJECTION:
return_string = "Projection("
return_string += return_gdscript_code_which_run_this_object(data.x)
return_string += ", "
return_string += return_gdscript_code_which_run_this_object(data.y)
return_string += ", "
return_string += return_gdscript_code_which_run_this_object(data.z)
return_string += ", "
return_string += return_gdscript_code_which_run_this_object(data.w)
return_string += ")"
elif type == TYPE_STRING_NAME:
return_string = "StringName("
return_string += return_gdscript_code_which_run_this_object(str(data))
Expand Down
8 changes: 7 additions & 1 deletion AutomaticBugs/ValueCreator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ func get_vector3() -> Vector3:
func get_vector3i() -> Vector3i:
return Vector3i(get_int(), get_int(), get_int())


func get_vector4() -> Vector4:
return Vector4(get_float(), get_float(), get_float(), get_float())


func get_vector4i() -> Vector4i:
return Vector4i(get_int(), get_int(), get_int(), get_int())


func get_projection() -> Projection:
return Projection(get_vector4(), get_vector4(), get_vector4(), get_vector4())


func get_aabb() -> AABB:
return AABB(get_vector3(), get_vector3())

Expand All @@ -73,7 +79,7 @@ func get_plane() -> Plane:


func get_quaternion() -> Quaternion:
return Quaternion(get_vector3())
return Quaternion(get_vector3(), get_float())


func get_basis() -> Basis:
Expand Down
6 changes: 4 additions & 2 deletions CreatingAllThings/CreatingAllThings.gd
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
extends Node2D

var available_classes: Array = []
var exeptions: Array = ["AppProtocol", "SceneTree", "EditorSettings", "ProjectSettings", "InputEventShortcut", "InputMap", "ThemeDB", "NavigationMeshGenerator"]
var exceptions: Array = []


func _ready():
exceptions = Engine.get_singleton_list()

var cl: Array = Array(ClassDB.get_class_list())
cl.sort()
for name_of_class in cl:
# Repeat 3 times, to be sure that code don't crash in unreleated function
for _i in range(3):
if !ClassDB.can_instantiate(name_of_class):
continue
if name_of_class in exeptions:
if name_of_class in exceptions:
continue
if name_of_class.to_lower().find("server") != -1:
continue
Expand Down
29 changes: 0 additions & 29 deletions Physics/2D/Area2D.gd

This file was deleted.

19 changes: 0 additions & 19 deletions Physics/2D/Area2D.tscn

This file was deleted.

21 changes: 0 additions & 21 deletions Physics/2D/KinematicBody2D.gd

This file was deleted.

15 changes: 0 additions & 15 deletions Physics/2D/KinematicBody2D.tscn

This file was deleted.

5 changes: 0 additions & 5 deletions Physics/2D/Physics2D.gd

This file was deleted.

Loading

0 comments on commit bab196a

Please sign in to comment.