reset transformation components to their default value by double clicking on gizmos' grabbers

This commit is contained in:
Enrico Turri
2018-09-19 15:39:54 +02:00
parent 3f0968fb02
commit c9acd1252a
5 changed files with 83 additions and 0 deletions

View File

@@ -759,6 +759,20 @@ void GLGizmoScale3D::on_update(const Linef3& mouse_ray)
do_scale_uniform(mouse_ray);
}
#if ENABLE_GIZMOS_RESET
void GLGizmoScale3D::on_process_double_click()
{
if ((m_hover_id == 0) || (m_hover_id == 1))
m_scale(0) = 1.0;
else if ((m_hover_id == 2) || (m_hover_id == 3))
m_scale(1) = 1.0;
else if ((m_hover_id == 4) || (m_hover_id == 5))
m_scale(2) = 1.0;
else if (m_hover_id >= 6)
m_scale = Vec3d::Ones();
}
#endif // ENABLE_GIZMOS_RESET
void GLGizmoScale3D::on_render(const BoundingBoxf3& box) const
{
if (m_grabbers[0].dragging || m_grabbers[1].dragging)