Removed check of max rotation close to zero in GLCanvas3D::Selection::rotate()

This commit is contained in:
Enrico Turri 2019-01-28 09:59:22 +01:00
parent 1550ee0e2b
commit 6f25a933b6

View File

@ -1804,10 +1804,12 @@ static double rotation_diff_z(const Vec3d &rot_xyz_from, const Vec3d &rot_xyz_to
void GLCanvas3D::Selection::rotate(const Vec3d& rotation, bool local) void GLCanvas3D::Selection::rotate(const Vec3d& rotation, bool local)
{ {
int rot_axis_max; if (!m_valid)
if (!m_valid || rotation.cwiseAbs().maxCoeff(&rot_axis_max) < EPSILON)
return; return;
int rot_axis_max;
rotation.cwiseAbs().maxCoeff(&rot_axis_max);
// For generic rotation, we want to rotate the first volume in selection, and then to synchronize the other volumes with it. // For generic rotation, we want to rotate the first volume in selection, and then to synchronize the other volumes with it.
std::vector<int> object_instance_first(m_model->objects.size(), -1); std::vector<int> object_instance_first(m_model->objects.size(), -1);
auto rotate_instance = [this, &rotation, &object_instance_first, rot_axis_max, local](GLVolume &volume, int i) { auto rotate_instance = [this, &rotation, &object_instance_first, rot_axis_max, local](GLVolume &volume, int i) {