Fixed SLA clippling plane & picking.

This commit is contained in:
bubnikv 2019-04-12 16:08:40 +02:00
parent 95eb98a103
commit 80afb6da78
3 changed files with 5 additions and 4 deletions

View File

@ -3527,12 +3527,12 @@ void GLCanvas3D::_picking_pass() const
glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
m_camera_clipping_plane = m_gizmos.get_sla_clipping_plane();
if (! m_use_VBOs) {
if (m_camera_clipping_plane.is_active()) {
::glClipPlane(GL_CLIP_PLANE0, (GLdouble*)m_camera_clipping_plane.get_data());
::glEnable(GL_CLIP_PLANE0);
}
_render_volumes_for_picking();
if (! m_use_VBOs)
if (m_camera_clipping_plane.is_active())
::glDisable(GL_CLIP_PLANE0);
m_gizmos.render_current_gizmo_for_picking_pass(m_selection);

View File

@ -88,6 +88,8 @@ public:
m_data[3] = offset;
}
bool is_active() const { return m_data[3] != DBL_MAX; }
static ClippingPlane ClipsNothing() { return ClippingPlane(Vec3d(0., 0., 1.), DBL_MAX); }
const double* get_data() const { return m_data; }

View File

@ -706,7 +706,7 @@ void GLGizmoSlaSupports::update_cache_entry_normal(unsigned int i) const
ClippingPlane GLGizmoSlaSupports::get_sla_clipping_plane() const
{
if (!m_model_object)
if (!m_model_object || m_state == Off)
return ClippingPlane::ClipsNothing();
Eigen::Matrix<GLdouble, 4, 4, Eigen::DontAlign> modelview_matrix;
@ -939,7 +939,6 @@ std::string GLGizmoSlaSupports::on_get_name() const
void GLGizmoSlaSupports::on_set_state()
{
if (m_state == On && m_old_state != On) { // the gizmo was just turned on
if (is_mesh_update_necessary())
update_mesh();