Merge pull request #90584 from BMagnu/fix_global_rotation_matrix

Fix `Node3D.set_global_rotation()` resetting node scale.
This commit is contained in:
Rémi Verschelde 2024-04-18 12:24:27 +02:00
commit d2ec3714d7
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -293,7 +293,7 @@ Vector3 Node3D::get_global_rotation_degrees() const {
void Node3D::set_global_rotation(const Vector3 &p_euler_rad) {
ERR_THREAD_GUARD;
Transform3D transform = get_global_transform();
transform.basis = Basis::from_euler(p_euler_rad);
transform.basis = Basis::from_euler(p_euler_rad) * Basis::from_scale(transform.basis.get_scale());
set_global_transform(transform);
}