mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Fixed unselected instance synchronization when rotating using rotate gizmo
This commit is contained in:
@@ -1189,17 +1189,12 @@ Vec3d extract_euler_angles(const Eigen::Matrix<double, 3, 3, Eigen::DontAlign>&
|
||||
Vec3d angles2 = Vec3d::Zero();
|
||||
if (is_approx(std::abs(rotation_matrix(2, 0)), 1.0))
|
||||
{
|
||||
angles1(2) = 0.0;
|
||||
if (rotation_matrix(2, 0) > 0.0) // == +1.0
|
||||
{
|
||||
angles1(1) = -0.5 * (double)PI;
|
||||
angles1(0) = -angles1(2) + ::atan2(-rotation_matrix(0, 1), -rotation_matrix(0, 2));
|
||||
}
|
||||
else // == -1.0
|
||||
{
|
||||
angles1(1) = 0.5 * (double)PI;
|
||||
angles1(0) = angles1(2) + ::atan2(rotation_matrix(0, 1), rotation_matrix(0, 2));
|
||||
}
|
||||
// the handling of singular cases deviates from the cited paper
|
||||
// the following code works better when rotating an object with the gizmo after having
|
||||
// changed its orientation using the place on bed gizmo
|
||||
angles1(0) = 0.0;
|
||||
angles1(1) = 0.5 * (double)PI;
|
||||
angles1(2) = angles1(0) + ::atan2(rotation_matrix(0, 1), rotation_matrix(0, 2));
|
||||
angles2 = angles1;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user