diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-05 13:32:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-05 13:32:08 +0200 |
commit | 6f7d45d2109246e3888fc2b16136915e6fec89fd (patch) | |
tree | ce03eee0b483c299863927e7c75390dead4d9540 /editor | |
parent | 537d8899e9cb97b2ba0b154496dcdd295163c4bd (diff) | |
parent | 8acd13a456050ded00f0f264ff0aa91a304f6c54 (diff) |
Merge pull request #45364 from madmiraal/rename-quat
Rename Quat to Quaternion
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 18 | ||||
-rw-r--r-- | editor/connections_dialog.cpp | 6 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 24 | ||||
-rw-r--r-- | editor/editor_properties.h | 6 | ||||
-rw-r--r-- | editor/editor_properties_array_dict.cpp | 4 | ||||
-rw-r--r-- | editor/import/editor_import_collada.cpp | 4 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 8 | ||||
-rw-r--r-- | editor/property_editor.cpp | 12 |
8 files changed, 41 insertions, 41 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index bd29eb973d..fde75e0f0c 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -525,7 +525,7 @@ public: switch (animation->track_get_type(track)) { case Animation::TYPE_TRANSFORM3D: { p_list->push_back(PropertyInfo(Variant::VECTOR3, "location")); - p_list->push_back(PropertyInfo(Variant::QUAT, "rotation")); + p_list->push_back(PropertyInfo(Variant::QUATERNION, "rotation")); p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale")); } break; @@ -1164,7 +1164,7 @@ public: switch (animation->track_get_type(first_track)) { case Animation::TYPE_TRANSFORM3D: { p_list->push_back(PropertyInfo(Variant::VECTOR3, "location")); - p_list->push_back(PropertyInfo(Variant::QUAT, "rotation")); + p_list->push_back(PropertyInfo(Variant::QUATERNION, "rotation")); p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale")); } break; case Animation::TYPE_VALUE: { @@ -3376,7 +3376,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) { case Variant::FLOAT: case Variant::VECTOR2: case Variant::VECTOR3: - case Variant::QUAT: + case Variant::QUATERNION: case Variant::PLANE: case Variant::COLOR: { // Valid. @@ -3845,7 +3845,7 @@ static Vector<String> _get_bezier_subindices_for_type(Variant::Type p_type, bool subindices.push_back(":y"); subindices.push_back(":z"); } break; - case Variant::QUAT: { + case Variant::QUATERNION: { subindices.push_back(":x"); subindices.push_back(":y"); subindices.push_back(":z"); @@ -3911,7 +3911,7 @@ AnimationTrackEditor::TrackIndices AnimationTrackEditor::_confirm_insert(InsertD h.type == Variant::RECT2 || h.type == Variant::VECTOR3 || h.type == Variant::AABB || - h.type == Variant::QUAT || + h.type == Variant::QUATERNION || h.type == Variant::COLOR || h.type == Variant::PLANE || h.type == Variant::TRANSFORM2D || @@ -3950,7 +3950,7 @@ AnimationTrackEditor::TrackIndices AnimationTrackEditor::_confirm_insert(InsertD Dictionary d; d["location"] = tr.origin; d["scale"] = tr.basis.get_scale(); - d["rotation"] = Quat(tr.basis); + d["rotation"] = Quaternion(tr.basis); value = d; } break; case Animation::TYPE_BEZIER: { @@ -4394,7 +4394,7 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) { filter.push_back(Variant::FLOAT); filter.push_back(Variant::VECTOR2); filter.push_back(Variant::VECTOR3); - filter.push_back(Variant::QUAT); + filter.push_back(Variant::QUATERNION); filter.push_back(Variant::PLANE); filter.push_back(Variant::COLOR); @@ -4464,7 +4464,7 @@ void AnimationTrackEditor::_new_track_property_selected(String p_name) { h.type == Variant::RECT2 || h.type == Variant::VECTOR3 || h.type == Variant::AABB || - h.type == Variant::QUAT || + h.type == Variant::QUATERNION || h.type == Variant::COLOR || h.type == Variant::PLANE || h.type == Variant::TRANSFORM2D || @@ -4564,7 +4564,7 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) { Vector3 loc = xf.get_origin(); Vector3 scale = xf.basis.get_scale_local(); - Quat rot = xf.basis; + Quaternion rot = xf.basis; undo_redo->create_action(TTR("Add Transform Track Key")); undo_redo->add_do_method(animation.ptr(), "transform_track_insert_key", p_track, p_ofs, loc, rot, scale); diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 5fcee1851d..3c0651f019 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -203,8 +203,8 @@ void ConnectDialog::_add_bind() { case Variant::PLANE: value = Plane(); break; - case Variant::QUAT: - value = Quat(); + case Variant::QUATERNION: + value = Quaternion(); break; case Variant::AABB: value = AABB(); @@ -443,7 +443,7 @@ ConnectDialog::ConnectDialog() { type_list->add_item("Rect2", Variant::RECT2); type_list->add_item("Vector3", Variant::VECTOR3); type_list->add_item("Plane", Variant::PLANE); - type_list->add_item("Quat", Variant::QUAT); + type_list->add_item("Quaternion", Variant::QUATERNION); type_list->add_item("AABB", Variant::AABB); type_list->add_item("Basis", Variant::BASIS); type_list->add_item("Transform", Variant::TRANSFORM3D); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 2088ea7ca6..ece7094767 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -1761,14 +1761,14 @@ EditorPropertyPlane::EditorPropertyPlane(bool p_force_wide) { setting = false; } -///////////////////// QUAT ///////////////////////// +///////////////////// QUATERNION ///////////////////////// -void EditorPropertyQuat::_value_changed(double val, const String &p_name) { +void EditorPropertyQuaternion::_value_changed(double val, const String &p_name) { if (setting) { return; } - Quat p; + Quaternion p; p.x = spin[0]->get_value(); p.y = spin[1]->get_value(); p.z = spin[2]->get_value(); @@ -1776,8 +1776,8 @@ void EditorPropertyQuat::_value_changed(double val, const String &p_name) { emit_changed(get_edited_property(), p, p_name); } -void EditorPropertyQuat::update_property() { - Quat val = get_edited_object()->get(get_edited_property()); +void EditorPropertyQuaternion::update_property() { + Quaternion val = get_edited_object()->get(get_edited_property()); setting = true; spin[0]->set_value(val.x); spin[1]->set_value(val.y); @@ -1786,7 +1786,7 @@ void EditorPropertyQuat::update_property() { setting = false; } -void EditorPropertyQuat::_notification(int p_what) { +void EditorPropertyQuaternion::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) { Color base = get_theme_color("accent_color", "Editor"); for (int i = 0; i < 3; i++) { @@ -1797,10 +1797,10 @@ void EditorPropertyQuat::_notification(int p_what) { } } -void EditorPropertyQuat::_bind_methods() { +void EditorPropertyQuaternion::_bind_methods() { } -void EditorPropertyQuat::setup(double p_min, double p_max, double p_step, bool p_no_slider) { +void EditorPropertyQuaternion::setup(double p_min, double p_max, double p_step, bool p_no_slider) { for (int i = 0; i < 4; i++) { spin[i]->set_min(p_min); spin[i]->set_max(p_max); @@ -1811,7 +1811,7 @@ void EditorPropertyQuat::setup(double p_min, double p_max, double p_step, bool p } } -EditorPropertyQuat::EditorPropertyQuat() { +EditorPropertyQuaternion::EditorPropertyQuaternion() { bool horizontal = EDITOR_GET("interface/inspector/horizontal_vector_types_editing"); BoxContainer *bc; @@ -1832,7 +1832,7 @@ EditorPropertyQuat::EditorPropertyQuat() { spin[i]->set_label(desc[i]); bc->add_child(spin[i]); add_focusable(spin[i]); - spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyQuat::_value_changed), varray(desc[i])); + spin[i]->connect("value_changed", callable_mp(this, &EditorPropertyQuaternion::_value_changed), varray(desc[i])); if (horizontal) { spin[i]->set_h_size_flags(SIZE_EXPAND_FILL); } @@ -3056,8 +3056,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ editor->setup(min, max, step, hide_slider); add_property_editor(p_path, editor); } break; - case Variant::QUAT: { - EditorPropertyQuat *editor = memnew(EditorPropertyQuat); + case Variant::QUATERNION: { + EditorPropertyQuaternion *editor = memnew(EditorPropertyQuaternion); double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 2638a6666a..121848d936 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -465,8 +465,8 @@ public: EditorPropertyPlane(bool p_force_wide = false); }; -class EditorPropertyQuat : public EditorProperty { - GDCLASS(EditorPropertyQuat, EditorProperty); +class EditorPropertyQuaternion : public EditorProperty { + GDCLASS(EditorPropertyQuaternion, EditorProperty); EditorSpinSlider *spin[4]; bool setting; void _value_changed(double p_val, const String &p_name); @@ -478,7 +478,7 @@ protected: public: virtual void update_property() override; void setup(double p_min, double p_max, double p_step, bool p_no_slider); - EditorPropertyQuat(); + EditorPropertyQuaternion(); }; class EditorPropertyAABB : public EditorProperty { diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 93a5246660..bfa85f4aab 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -850,8 +850,8 @@ void EditorPropertyDictionary::update_property() { prop = editor; } break; - case Variant::QUAT: { - EditorPropertyQuat *editor = memnew(EditorPropertyQuat); + case Variant::QUATERNION: { + EditorPropertyQuaternion *editor = memnew(EditorPropertyQuaternion); editor->setup(-100000, 100000, 0.001, true); prop = editor; diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index e080586faa..dc1bd38a99 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1545,7 +1545,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones Vector3 s = xform.basis.get_scale(); bool singular_matrix = Math::is_equal_approx(s.x, 0.0f) || Math::is_equal_approx(s.y, 0.0f) || Math::is_equal_approx(s.z, 0.0f); - Quat q = singular_matrix ? Quat() : xform.basis.get_rotation_quat(); + Quaternion q = singular_matrix ? Quaternion() : xform.basis.get_rotation_quaternion(); Vector3 l = xform.origin; animation->transform_track_insert_key(track, snapshots[i], l, q, s); @@ -1596,7 +1596,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones Vector3 s = xform.basis.get_scale(); bool singular_matrix = Math::is_equal_approx(s.x, 0.0f) || Math::is_equal_approx(s.y, 0.0f) || Math::is_equal_approx(s.z, 0.0f); - Quat q = singular_matrix ? Quat() : xform.basis.get_rotation_quat(); + Quaternion q = singular_matrix ? Quaternion() : xform.basis.get_rotation_quaternion(); Vector3 l = xform.origin; animation->transform_track_insert_key(track, 0, l, q, s); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index f7a7fdebda..b589a6aaa0 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -857,7 +857,7 @@ void ResourceImporterScene::_create_clips(AnimationPlayer *anim, const Array &p_ if (kt > (from + 0.01) && k > 0) { if (default_anim->track_get_type(j) == Animation::TYPE_TRANSFORM3D) { - Quat q; + Quaternion q; Vector3 p; Vector3 s; default_anim->transform_track_interpolate(j, from, &p, &q, &s); @@ -871,7 +871,7 @@ void ResourceImporterScene::_create_clips(AnimationPlayer *anim, const Array &p_ } if (default_anim->track_get_type(j) == Animation::TYPE_TRANSFORM3D) { - Quat q; + Quaternion q; Vector3 p; Vector3 s; default_anim->transform_track_get_key(j, k, &p, &q, &s); @@ -885,7 +885,7 @@ void ResourceImporterScene::_create_clips(AnimationPlayer *anim, const Array &p_ if (dtrack != -1 && kt >= to) { if (default_anim->track_get_type(j) == Animation::TYPE_TRANSFORM3D) { - Quat q; + Quaternion q; Vector3 p; Vector3 s; default_anim->transform_track_interpolate(j, to, &p, &q, &s); @@ -903,7 +903,7 @@ void ResourceImporterScene::_create_clips(AnimationPlayer *anim, const Array &p_ dtrack = new_anim->get_track_count() - 1; new_anim->track_set_path(dtrack, default_anim->track_get_path(j)); if (default_anim->track_get_type(j) == Animation::TYPE_TRANSFORM3D) { - Quat q; + Quaternion q; Vector3 p; Vector3 s; default_anim->transform_track_interpolate(j, from, &p, &q, &s); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ea2a800a10..7a4b0964fa 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -727,13 +727,13 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: value_editor[3]->set_text(String::num(plane.d)); } break; - case Variant::QUAT: { + case Variant::QUATERNION: { field_names.push_back("x"); field_names.push_back("y"); field_names.push_back("z"); field_names.push_back("w"); config_value_editors(4, 4, 10, field_names); - Quat q = v; + Quaternion q = v; value_editor[0]->set_text(String::num(q.x)); value_editor[1]->set_text(String::num(q.y)); value_editor[2]->set_text(String::num(q.z)); @@ -1513,8 +1513,8 @@ void CustomPropertyEditor::_modified(String p_string) { _emit_changed_whole_or_field(); } break; - case Variant::QUAT: { - Quat q; + case Variant::QUATERNION: { + Quaternion q; q.x = _parse_real_expression(value_editor[0]->get_text()); q.y = _parse_real_expression(value_editor[1]->get_text()); q.z = _parse_real_expression(value_editor[2]->get_text()); @@ -1635,7 +1635,7 @@ void CustomPropertyEditor::_focus_enter() { case Variant::RECT2: case Variant::VECTOR3: case Variant::PLANE: - case Variant::QUAT: + case Variant::QUATERNION: case Variant::AABB: case Variant::TRANSFORM2D: case Variant::BASIS: @@ -1661,7 +1661,7 @@ void CustomPropertyEditor::_focus_exit() { case Variant::RECT2: case Variant::VECTOR3: case Variant::PLANE: - case Variant::QUAT: + case Variant::QUATERNION: case Variant::AABB: case Variant::TRANSFORM2D: case Variant::BASIS: |