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

@ -336,13 +336,11 @@ void GLGizmoRotate::render_grabber_extension(const BoundingBoxf3& box, bool pick
if (shader == nullptr)
return;
if (! picking) {
const_cast<GLModel*>(&m_cone)->set_color(-1, color);
if (!picking) {
shader->start_using();
shader->set_uniform("emission_factor", 0.1);
const_cast<GLModel*>(&m_cone)->set_color(-1, color);
}
else
glsafe(::glColor4fv(color.data()));
glsafe(::glPushMatrix());
glsafe(::glTranslated(m_grabbers[0].center.x(), m_grabbers[0].center.y(), m_grabbers[0].center.z()));