Tech ENABLE_GLBEGIN_GLEND_REMOVAL - Added method void init_from(const TriangleMesh& mesh) to GLModel

This commit is contained in:
enricoturri1966 2022-01-27 13:45:30 +01:00
parent 9d764bfeac
commit 5db3c66cf7
4 changed files with 18 additions and 7 deletions

View file

@ -39,7 +39,7 @@ void GLGizmoBase::Grabber::render(float size, const ColorRGBA& render_color, boo
#if ENABLE_GLBEGIN_GLEND_REMOVAL
m_cube.init_from(its);
#else
const_cast<GLModel&>(m_cube).init_from(its, BoundingBoxf3{ { -0.5, -0.5, -0.5 }, { 0.5, 0.5, 0.5 } });
m_cube.init_from(its, BoundingBoxf3{ { -0.5, -0.5, -0.5 }, { 0.5, 0.5, 0.5 } });
#endif // ENABLE_GLBEGIN_GLEND_REMOVAL
}
@ -48,7 +48,7 @@ void GLGizmoBase::Grabber::render(float size, const ColorRGBA& render_color, boo
#if ENABLE_GLBEGIN_GLEND_REMOVAL
m_cube.set_color(render_color);
#else
const_cast<GLModel*>(&m_cube)->set_color(-1, render_color);
m_cube.set_color(-1, render_color);
#endif // ENABLE_GLBEGIN_GLEND_REMOVAL
glsafe(::glPushMatrix());