summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorSilc Renew <tokage.it.lab@gmail.com>2023-02-04 00:45:12 +0900
committerSilc Renew <tokage.it.lab@gmail.com>2023-02-04 00:46:04 +0900
commit1459b9c24c9bf7c4781fde3ea55c0dbd9b020e2f (patch)
treed38c5be867ee987248e4016b6282eea9e9798a23 /editor/plugins
parent604493eb6ee3def65aca089c1d4bc71ea03ca19a (diff)
Fix scaled_orthogonal() & subgizmo global scaling
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp5
-rw-r--r--editor/plugins/skeleton_3d_editor_plugin.cpp2
2 files changed, 2 insertions, 5 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 36d1e54246..b001b4f766 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1415,9 +1415,6 @@ Transform3D Node3DEditorViewport::_compute_transform(TransformMode p_mode, const
// Recalculate orthogonalized scale without moving origin.
if (p_orthogonal) {
s.basis = p_original.basis.scaled_orthogonal(p_motion + Vector3(1, 1, 1));
- // The scaled_orthogonal() does not require orthogonal Basis,
- // but it may make a bit skew by precision problems.
- s.basis.orthogonalize();
}
}
@@ -4634,7 +4631,7 @@ void Node3DEditorViewport::update_transform(Point2 p_mousepos, bool p_shift) {
if (se->gizmo.is_valid()) {
for (KeyValue<int, Transform3D> &GE : se->subgizmos) {
Transform3D xform = GE.value;
- Transform3D new_xform = _compute_transform(TRANSFORM_SCALE, se->original * xform, xform, motion, snap, local_coords, true); // Force orthogonal with subgizmo.
+ Transform3D new_xform = _compute_transform(TRANSFORM_SCALE, se->original * xform, xform, motion, snap, local_coords, _edit.plane != TRANSFORM_VIEW); // Force orthogonal with subgizmo.
if (!local_coords) {
new_xform = se->original.affine_inverse() * new_xform;
}
diff --git a/editor/plugins/skeleton_3d_editor_plugin.cpp b/editor/plugins/skeleton_3d_editor_plugin.cpp
index 782e365138..7f43de3240 100644
--- a/editor/plugins/skeleton_3d_editor_plugin.cpp
+++ b/editor/plugins/skeleton_3d_editor_plugin.cpp
@@ -1301,7 +1301,7 @@ void Skeleton3DGizmoPlugin::set_subgizmo_transform(const EditorNode3DGizmo *p_gi
Transform3D original_to_local;
int parent_idx = skeleton->get_bone_parent(p_id);
if (parent_idx >= 0) {
- original_to_local = original_to_local * skeleton->get_bone_global_pose(parent_idx);
+ original_to_local = skeleton->get_bone_global_pose(parent_idx);
}
Basis to_local = original_to_local.get_basis().inverse();