Fixed scaling of multivolumes selection - Added local scale by pressing Alt key while dragging the scale gizmo

This commit is contained in:
Enrico Turri 2018-11-20 15:39:36 +01:00
parent f6831dfdea
commit bcfff27921
4 changed files with 35 additions and 12 deletions

View file

@ -787,13 +787,14 @@ void GLGizmoScale3D::on_render(const GLCanvas3D::Selection& selection) const
const GLCanvas3D::Selection::IndicesList& idxs = selection.get_volume_idxs();
for (unsigned int idx : idxs)
{
box.merge(selection.get_volume(idx)->bounding_box);
const GLVolume* vol = selection.get_volume(idx);
box.merge(vol->bounding_box.transformed(vol->get_volume_transformation().get_matrix()));
}
// gets transform from first selected volume
const GLVolume* v = selection.get_volume(*idxs.begin());
#if ENABLE_MODELVOLUME_TRANSFORM
transform = v->world_matrix();
transform = v->get_instance_transformation().get_matrix();
// gets angles from first selected volume
angles = v->get_instance_rotation();
// consider rotation+mirror only components of the transform for offsets