Refactoring in GLModel::render() to simplify client code

This commit is contained in:
enricoturri1966 2021-07-20 12:36:56 +02:00
parent c61785f775
commit fd5cf8d0cc
6 changed files with 20 additions and 34 deletions

View file

@ -205,12 +205,11 @@ void GLGizmoMove3D::render_grabber_extension(Axis axis, const BoundingBoxf3& box
if (shader == nullptr)
return;
if (! picking) {
const_cast<GLModel*>(&m_vbo_cone)->set_color(-1, color);
if (!picking) {
shader->start_using();
shader->set_uniform("emission_factor", 0.1);
const_cast<GLModel*>(&m_vbo_cone)->set_color(-1, color);
} else
glsafe(::glColor4fv(color.data()));
}
glsafe(::glPushMatrix());
glsafe(::glTranslated(m_grabbers[axis].center.x(), m_grabbers[axis].center.y(), m_grabbers[axis].center.z()));