3D gizmos grabbers always visible to picking pass

This commit is contained in:
Enrico Turri 2018-08-24 11:17:53 +02:00
parent 95ae2d715b
commit 7f542a0f85
2 changed files with 10 additions and 11 deletions

View File

@ -2352,13 +2352,14 @@ void GLCanvas3D::render()
float theta = m_camera.get_theta(); float theta = m_camera.get_theta();
bool is_custom_bed = m_bed.is_custom(); bool is_custom_bed = m_bed.is_custom();
// picking pass
_picking_pass(); _picking_pass();
_render_background();
// draw scene
_render_background();
_render_current_gizmo(); _render_current_gizmo();
// untextured bed needs to be rendered before objects if (is_custom_bed) // untextured bed needs to be rendered before objects
if (is_custom_bed)
{ {
_render_bed(theta); _render_bed(theta);
// disable depth testing so that axes are not covered by ground // disable depth testing so that axes are not covered by ground
@ -2366,13 +2367,15 @@ void GLCanvas3D::render()
} }
_render_objects(); _render_objects();
// textured bed needs to be rendered after objects if (!is_custom_bed) // textured bed needs to be rendered after objects
if (!is_custom_bed)
{ {
_render_axes(true); _render_axes(true);
_render_bed(theta); _render_bed(theta);
} }
_render_cutting_plane(); _render_cutting_plane();
// draw overlays
_render_gizmos_overlay(); _render_gizmos_overlay();
_render_warning_texture(); _render_warning_texture();
_render_legend_texture(); _render_legend_texture();
@ -3819,8 +3822,8 @@ void GLCanvas3D::_picking_pass() const
::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); ::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_gizmos.render_current_gizmo_for_picking_pass(_selected_volumes_bounding_box());
_render_volumes(true); _render_volumes(true);
m_gizmos.render_current_gizmo_for_picking_pass(_selected_volumes_bounding_box());
if (m_multisample_allowed) if (m_multisample_allowed)
::glEnable(GL_MULTISAMPLE); ::glEnable(GL_MULTISAMPLE);

View File

@ -373,11 +373,7 @@ void GLGizmoRotate::on_render(const BoundingBoxf3& box) const
void GLGizmoRotate::on_render_for_picking(const BoundingBoxf3& box) const void GLGizmoRotate::on_render_for_picking(const BoundingBoxf3& box) const
{ {
#if ENABLE_GIZMOS_3D
::glEnable(GL_DEPTH_TEST);
#else
::glDisable(GL_DEPTH_TEST); ::glDisable(GL_DEPTH_TEST);
#endif // ENABLE_GIZMOS_3D
::glPushMatrix(); ::glPushMatrix();
transform_to_local(); transform_to_local();
@ -926,7 +922,7 @@ void GLGizmoScale3D::on_render(const BoundingBoxf3& box) const
void GLGizmoScale3D::on_render_for_picking(const BoundingBoxf3& box) const void GLGizmoScale3D::on_render_for_picking(const BoundingBoxf3& box) const
{ {
::glEnable(GL_DEPTH_TEST); ::glDisable(GL_DEPTH_TEST);
for (unsigned int i = 0; i < (unsigned int)m_grabbers.size(); ++i) for (unsigned int i = 0; i < (unsigned int)m_grabbers.size(); ++i)
{ {