Fix issue with auto orient a scaled object. (#3904)

Partly revert 73ab032e8288cbcadfe41691c590561a469b57f9
This commit is contained in:
Noisyfox 2024-01-30 22:28:49 +08:00 committed by SoftFever
parent 989fab03c0
commit 8a42aed683

View File

@ -1298,8 +1298,10 @@ public:
// BBS
void rotate(Matrix3d rotation_matrix) {
const Geometry::Transformation& old_inst_trafo = get_transformation();
set_transformation(Geometry::Transformation{old_inst_trafo.get_offset_matrix() * rotation_matrix * old_inst_trafo.get_matrix_no_offset()});
auto R = m_transformation.get_rotation_matrix().matrix().block<3, 3>(0, 0);
auto R_new = rotation_matrix * R;
auto euler_angles = Geometry::extract_euler_angles(R_new);
set_rotation(euler_angles);
}
Vec3d get_scaling_factor() const { return m_transformation.get_scaling_factor(); }