diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/debugger/debug_adapter/debug_adapter_protocol.cpp | 24 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 2 | ||||
-rw-r--r-- | editor/import/collada.cpp | 36 | ||||
-rw-r--r-- | editor/plugins/animation_state_machine_editor.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/polygon_2d_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/property_editor.cpp | 12 |
8 files changed, 45 insertions, 45 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp index 745ca17efd..fea4c2b156 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp @@ -268,12 +268,12 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) { x.type = type_vec2; y.type = type_vec2; origin.type = type_vec2; - x.value = transform.elements[0]; - y.value = transform.elements[1]; - origin.value = transform.elements[2]; - x.variablesReference = parse_variant(transform.elements[0]); - y.variablesReference = parse_variant(transform.elements[1]); - origin.variablesReference = parse_variant(transform.elements[2]); + x.value = transform.columns[0]; + y.value = transform.columns[1]; + origin.value = transform.columns[2]; + x.variablesReference = parse_variant(transform.columns[0]); + y.variablesReference = parse_variant(transform.columns[1]); + origin.variablesReference = parse_variant(transform.columns[2]); Array arr; arr.push_back(x.to_json()); @@ -357,12 +357,12 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) { x.type = type_vec3; y.type = type_vec3; z.type = type_vec3; - x.value = basis.elements[0]; - y.value = basis.elements[1]; - z.value = basis.elements[2]; - x.variablesReference = parse_variant(basis.elements[0]); - y.variablesReference = parse_variant(basis.elements[1]); - z.variablesReference = parse_variant(basis.elements[2]); + x.value = basis.rows[0]; + y.value = basis.rows[1]; + z.value = basis.rows[2]; + x.variablesReference = parse_variant(basis.rows[0]); + y.variablesReference = parse_variant(basis.rows[1]); + z.variablesReference = parse_variant(basis.rows[2]); Array arr; arr.push_back(x.to_json()); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 98391d286a..1c8d66e4be 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -812,7 +812,7 @@ void ScriptEditorDebugger::_notification(int p_what) { Transform2D transform; transform.scale_basis(Size2(zoom, zoom)); - transform.elements[2] = -offset * zoom; + transform.columns[2] = -offset * zoom; Array msg; msg.push_back(transform); diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp index af91ced570..e68c5e9a22 100644 --- a/editor/import/collada.cpp +++ b/editor/import/collada.cpp @@ -105,15 +105,15 @@ Transform3D Collada::fix_transform(const Transform3D &p_transform) { static Transform3D _read_transform_from_array(const Vector<float> &array, int ofs = 0) { Transform3D tr; // i wonder why collada matrices are transposed, given that's opposed to opengl.. - tr.basis.elements[0][0] = array[0 + ofs]; - tr.basis.elements[0][1] = array[1 + ofs]; - tr.basis.elements[0][2] = array[2 + ofs]; - tr.basis.elements[1][0] = array[4 + ofs]; - tr.basis.elements[1][1] = array[5 + ofs]; - tr.basis.elements[1][2] = array[6 + ofs]; - tr.basis.elements[2][0] = array[8 + ofs]; - tr.basis.elements[2][1] = array[9 + ofs]; - tr.basis.elements[2][2] = array[10 + ofs]; + tr.basis.rows[0][0] = array[0 + ofs]; + tr.basis.rows[0][1] = array[1 + ofs]; + tr.basis.rows[0][2] = array[2 + ofs]; + tr.basis.rows[1][0] = array[4 + ofs]; + tr.basis.rows[1][1] = array[5 + ofs]; + tr.basis.rows[1][2] = array[6 + ofs]; + tr.basis.rows[2][0] = array[8 + ofs]; + tr.basis.rows[2][1] = array[9 + ofs]; + tr.basis.rows[2][2] = array[10 + ofs]; tr.origin.x = array[3 + ofs]; tr.origin.y = array[7 + ofs]; tr.origin.z = array[11 + ofs]; @@ -210,15 +210,15 @@ Vector<float> Collada::AnimationTrack::get_value_at_time(float p_time) const { ret.resize(16); Transform3D tr; // i wonder why collada matrices are transposed, given that's opposed to opengl.. - ret.write[0] = interp.basis.elements[0][0]; - ret.write[1] = interp.basis.elements[0][1]; - ret.write[2] = interp.basis.elements[0][2]; - ret.write[4] = interp.basis.elements[1][0]; - ret.write[5] = interp.basis.elements[1][1]; - ret.write[6] = interp.basis.elements[1][2]; - ret.write[8] = interp.basis.elements[2][0]; - ret.write[9] = interp.basis.elements[2][1]; - ret.write[10] = interp.basis.elements[2][2]; + ret.write[0] = interp.basis.rows[0][0]; + ret.write[1] = interp.basis.rows[0][1]; + ret.write[2] = interp.basis.rows[0][2]; + ret.write[4] = interp.basis.rows[1][0]; + ret.write[5] = interp.basis.rows[1][1]; + ret.write[6] = interp.basis.rows[1][2]; + ret.write[8] = interp.basis.rows[2][0]; + ret.write[9] = interp.basis.rows[2][1]; + ret.write[10] = interp.basis.rows[2][2]; ret.write[3] = interp.origin.x; ret.write[7] = interp.origin.y; ret.write[11] = interp.origin.z; diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index fba59e701e..d3f25d7a85 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1087,9 +1087,9 @@ void AnimationNodeStateMachineEditor::_connection_draw(const Vector2 &p_from, co Ref<Texture2D> icon = icons[p_mode + (p_auto_advance ? 3 : 0)]; Transform2D xf; - xf.elements[0] = (p_to - p_from).normalized(); - xf.elements[1] = xf.elements[0].orthogonal(); - xf.elements[2] = (p_from + p_to) * 0.5 - xf.elements[1] * icon->get_height() * 0.5 - xf.elements[0] * icon->get_height() * 0.5; + xf.columns[0] = (p_to - p_from).normalized(); + xf.columns[1] = xf.columns[0].orthogonal(); + xf.columns[2] = (p_from + p_to) * 0.5 - xf.columns[1] * icon->get_height() * 0.5 - xf.columns[0] * icon->get_height() * 0.5; state_machine_draw->draw_set_transform_matrix(xf); if (p_multi_transitions) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 5d1e9705d8..d237697597 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3675,7 +3675,7 @@ void CanvasItemEditor::_draw_viewport() { // Update the transform transform = Transform2D(); transform.scale_basis(Size2(zoom, zoom)); - transform.elements[2] = -view_offset * zoom; + transform.columns[2] = -view_offset * zoom; EditorNode::get_singleton()->get_scene_root()->set_global_canvas_transform(transform); // hide/show buttons depending on the selection diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 8566e92b22..a682bb455c 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -455,7 +455,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { } Transform2D mtx; - mtx.elements[2] = -uv_draw_ofs; + mtx.columns[2] = -uv_draw_ofs; mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom)); Ref<InputEventMouseButton> mb = p_input; @@ -970,7 +970,7 @@ void Polygon2DEditor::_uv_draw() { String warning; Transform2D mtx; - mtx.elements[2] = -uv_draw_ofs; + mtx.columns[2] = -uv_draw_ofs; mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom)); RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index 3fa12233a8..455592aa26 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -78,7 +78,7 @@ void TextureRegionEditor::_region_draw() { } Transform2D mtx; - mtx.elements[2] = -draw_ofs * draw_zoom; + mtx.columns[2] = -draw_ofs * draw_zoom; mtx.scale_basis(Vector2(draw_zoom, draw_zoom)); RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx); @@ -267,7 +267,7 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) { } Transform2D mtx; - mtx.elements[2] = -draw_ofs * draw_zoom; + mtx.columns[2] = -draw_ofs * draw_zoom; mtx.scale_basis(Vector2(draw_zoom, draw_zoom)); const real_t handle_radius = 8 * EDSCALE; diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index f9c4fae405..5effdf0b36 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -768,7 +768,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: Transform2D basis = v; for (int i = 0; i < 6; i++) { - value_editor[i]->set_text(String::num(basis.elements[i / 2][i % 2])); + value_editor[i]->set_text(String::num(basis.columns[i / 2][i % 2])); } } break; @@ -786,7 +786,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: Basis basis = v; for (int i = 0; i < 9; i++) { - value_editor[i]->set_text(String::num(basis.elements[i / 3][i % 3])); + value_editor[i]->set_text(String::num(basis.rows[i / 3][i % 3])); } } break; @@ -807,7 +807,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: Transform3D tr = v; for (int i = 0; i < 9; i++) { - value_editor[(i / 3) * 4 + i % 3]->set_text(String::num(tr.basis.elements[i / 3][i % 3])); + value_editor[(i / 3) * 4 + i % 3]->set_text(String::num(tr.basis.rows[i / 3][i % 3])); } value_editor[3]->set_text(String::num(tr.origin.x)); @@ -1568,7 +1568,7 @@ void CustomPropertyEditor::_modified(String p_string) { case Variant::TRANSFORM2D: { Transform2D m; for (int i = 0; i < 6; i++) { - m.elements[i / 2][i % 2] = _parse_real_expression(value_editor[i]->get_text()); + m.columns[i / 2][i % 2] = _parse_real_expression(value_editor[i]->get_text()); } v = m; @@ -1580,7 +1580,7 @@ void CustomPropertyEditor::_modified(String p_string) { case Variant::BASIS: { Basis m; for (int i = 0; i < 9; i++) { - m.elements[i / 3][i % 3] = _parse_real_expression(value_editor[i]->get_text()); + m.rows[i / 3][i % 3] = _parse_real_expression(value_editor[i]->get_text()); } v = m; @@ -1592,7 +1592,7 @@ void CustomPropertyEditor::_modified(String p_string) { case Variant::TRANSFORM3D: { Basis basis; for (int i = 0; i < 9; i++) { - basis.elements[i / 3][i % 3] = _parse_real_expression(value_editor[(i / 3) * 4 + i % 3]->get_text()); + basis.rows[i / 3][i % 3] = _parse_real_expression(value_editor[(i / 3) * 4 + i % 3]->get_text()); } Vector3 origin; |