Fix caucluation of rotation between two vectors during auto-orient (#4144)

* Properly extract rotation matrix

* Another attempt to fix auto-orient
This commit is contained in:
Noisyfox 2024-02-20 22:28:06 +08:00 committed by GitHub
parent a74a1d26fd
commit bff50a5fd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View file

@ -1298,10 +1298,9 @@ public:
// BBS
void rotate(Matrix3d rotation_matrix) {
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);
auto rotation = m_transformation.get_rotation_matrix();
rotation = rotation_matrix * rotation;
set_rotation(Geometry::Transformation(rotation).get_rotation());
}
Vec3d get_scaling_factor() const { return m_transformation.get_scaling_factor(); }