From 328651939622009b69e7cc84eb53020ca16761cd Mon Sep 17 00:00:00 2001 From: sjfricke Date: Sat, 18 Feb 2017 03:53:27 -0600 Subject: [PATCH] New overload method tango_gl Simply added a single function overload to allow to set normals AND indenices at the same time when setting drawing objects info --- tango_gl/drawable_object.cc | 8 ++++++++ tango_gl/include/tango-gl/drawable_object.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/tango_gl/drawable_object.cc b/tango_gl/drawable_object.cc index e87974e7..f5382ea5 100644 --- a/tango_gl/drawable_object.cc +++ b/tango_gl/drawable_object.cc @@ -63,4 +63,12 @@ void DrawableObject::SetVertices(const std::vector& vertices, vertices_ = vertices; normals_ = normals; } + +void DrawableObject::SetVertices(const std::vector& vertices, + const std::vector& normals, + const std::vector& indices) { + vertices_ = vertices; + normals_ = normals; + indices_ = indices; +} } // namespace tango_gl diff --git a/tango_gl/include/tango-gl/drawable_object.h b/tango_gl/include/tango-gl/drawable_object.h index 2d0a5a06..ac7aecc6 100644 --- a/tango_gl/include/tango-gl/drawable_object.h +++ b/tango_gl/include/tango-gl/drawable_object.h @@ -40,6 +40,9 @@ class DrawableObject : public Transform { const std::vector& indices); void SetVertices(const std::vector& vertices, const std::vector& normals); + void SetVertices(const std::vector& vertices, + const std::vector& normals, + const std::vector& indices); virtual void Render(const glm::mat4& projection_mat, const glm::mat4& view_mat) const = 0;