Fixed translation of volumes belonging to scaled instances

This commit is contained in:
Enrico Turri 2018-11-30 10:59:00 +01:00
parent 62a3cb272e
commit 4e4760bb82

View File

@ -1467,7 +1467,7 @@ void GLCanvas3D::Selection::translate(const Vec3d& displacement)
(*m_volumes)[i]->set_instance_offset(m_cache.volumes_data[i].get_instance_position() + displacement);
else if (m_mode == Volume)
{
Vec3d local_displacement = m_cache.volumes_data[i].get_instance_rotation_matrix().inverse() * displacement;
Vec3d local_displacement = (m_cache.volumes_data[i].get_instance_rotation_matrix() * m_cache.volumes_data[i].get_instance_scale_matrix()).inverse() * displacement;
(*m_volumes)[i]->set_volume_offset(m_cache.volumes_data[i].get_volume_position() + local_displacement);
}
#else