summaryrefslogtreecommitdiff
path: root/modules/visual_script/editor
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-07-20 01:11:13 +0200
committerJuan Linietsky <reduzio@gmail.com>2022-07-23 14:00:01 +0200
commit455c06ecd466424cdf1b444a7c289b322390e795 (patch)
tree50c3f14dddba5e7dcd938450d360af2847be8e61 /modules/visual_script/editor
parentfe929d4787b2b11390891fb03da1dda78b18eb65 (diff)
Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
Diffstat (limited to 'modules/visual_script/editor')
-rw-r--r--modules/visual_script/editor/visual_script_editor.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/visual_script/editor/visual_script_editor.cpp b/modules/visual_script/editor/visual_script_editor.cpp
index 522ed8719b..74a61bc4b7 100644
--- a/modules/visual_script/editor/visual_script_editor.cpp
+++ b/modules/visual_script/editor/visual_script_editor.cpp
@@ -376,6 +376,12 @@ static Color _color_from_type(Variant::Type p_type, bool dark_theme = true) {
case Variant::VECTOR3I:
color = Color(0.84, 0.49, 0.93);
break;
+ case Variant::VECTOR4:
+ color = Color(0.84, 0.49, 0.94);
+ break;
+ case Variant::VECTOR4I:
+ color = Color(0.84, 0.49, 0.94);
+ break;
case Variant::TRANSFORM2D:
color = Color(0.77, 0.93, 0.41);
break;
@@ -4821,12 +4827,15 @@ VisualScriptEditor::VisualScriptEditor() {
base_type_map.insert("Rect2i", Variant::RECT2I);
base_type_map.insert("Vector3", Variant::VECTOR3);
base_type_map.insert("Vector3i", Variant::VECTOR3I);
+ base_type_map.insert("Vector4", Variant::VECTOR4);
+ base_type_map.insert("Vector4i", Variant::VECTOR4I);
base_type_map.insert("Transform2D", Variant::TRANSFORM2D);
base_type_map.insert("Plane", Variant::PLANE);
base_type_map.insert("Quaternion", Variant::QUATERNION);
base_type_map.insert("AABB", Variant::AABB);
base_type_map.insert("Basis", Variant::BASIS);
base_type_map.insert("Transform3D", Variant::TRANSFORM3D);
+ base_type_map.insert("Projection", Variant::PROJECTION);
base_type_map.insert("Color", Variant::COLOR);
base_type_map.insert("NodePath", Variant::NODE_PATH);
base_type_map.insert("RID", Variant::RID);