1st installment of constrained gizmo-scaling

This commit is contained in:
Enrico Turri 2019-05-10 11:13:55 +02:00
parent 244d0e3ecf
commit 128da453d5
16 changed files with 377 additions and 82 deletions

View file

@ -51,7 +51,10 @@ std::string GLGizmoMove3D::on_get_name() const
return (_(L("Move")) + " [M]").ToUTF8().data();
}
void GLGizmoMove3D::on_start_dragging(const Selection& selection)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
void GLGizmoMove3D::on_start_dragging(const Selection& selection, const UpdateData::Keys& keys)
//void GLGizmoMove3D::on_start_dragging(const Selection& selection)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
{
if (m_hover_id != -1)
{
@ -206,7 +209,10 @@ double GLGizmoMove3D::calc_projection(const UpdateData& data) const
projection = inters_vec.dot(starting_vec.normalized());
}
if (data.shift_down)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
if (data.keys.shift)
// if (data.shift_down)
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
projection = m_snap_step * (double)std::round(projection / m_snap_step);
return projection;