diff options
author | Silc 'Tokage' Renew <tokage.it.lab@gmail.com> | 2021-10-09 19:24:26 +0900 |
---|---|---|
committer | Silc 'Tokage' Renew <tokage.it.lab@gmail.com> | 2021-12-25 03:24:04 +0900 |
commit | 61759da5b35e44003ab3ffe3d4024dd611d17eff (patch) | |
tree | 8ffa512d0bcc5324ece5b279303d14cd2de8355b /scene/3d | |
parent | 42f8bfaff0dc5a94ca351b1eaadc42cb95655b87 (diff) |
Fix some gizmo behavior to make more consistent
Diffstat (limited to 'scene/3d')
-rw-r--r-- | scene/3d/node_3d.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index b7b88c7135..b69f6786ad 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -84,6 +84,9 @@ void Node3D::_notify_dirty() { } void Node3D::_update_local_transform() const { + if (this->get_rotation_edit_mode() != ROTATION_EDIT_MODE_BASIS) { + data.local_transform = data.local_transform.orthogonalized(); + } data.local_transform.basis.set_euler_scale(data.rotation, data.scale); data.dirty &= ~DIRTY_LOCAL; @@ -321,6 +324,14 @@ void Node3D::set_rotation_edit_mode(RotationEditMode p_mode) { return; } data.rotation_edit_mode = p_mode; + + // Shearing is not allowed except in ROTATION_EDIT_MODE_BASIS. + data.dirty |= DIRTY_LOCAL; + _propagate_transform_changed(this); + if (data.notify_local_transform) { + notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED); + } + notify_property_list_changed(); } |