diff --git a/src/math/bounding_box.cpp b/src/math/bounding_box.cpp index 22abb1c1..41a3859c 100755 --- a/src/math/bounding_box.cpp +++ b/src/math/bounding_box.cpp @@ -56,17 +56,15 @@ namespace math std::vector box_points(glm::vec3 const& box_min, glm::vec3 const& box_max) { - std::vector points; - - points.emplace_back(box_max.x, box_max.y, box_max.z); - points.emplace_back(box_max.x, box_max.y, box_min.z); - points.emplace_back(box_max.x, box_min.y, box_max.z); - points.emplace_back(box_max.x, box_min.y, box_min.z); - points.emplace_back(box_min.x, box_max.y, box_max.z); - points.emplace_back(box_min.x, box_max.y, box_min.z); - points.emplace_back(box_min.x, box_min.y, box_max.z); - points.emplace_back(box_min.x, box_min.y, box_min.z); - - return points; + return std::vector { + glm::vec3(box_max.x, box_max.y, box_max.z), + glm::vec3(box_max.x, box_max.y, box_min.z), + glm::vec3(box_max.x, box_min.y, box_max.z), + glm::vec3(box_max.x, box_min.y, box_min.z), + glm::vec3(box_min.x, box_max.y, box_max.z), + glm::vec3(box_min.x, box_max.y, box_min.z), + glm::vec3(box_min.x, box_min.y, box_max.z), + glm::vec3(box_min.x, box_min.y, box_min.z) + }; } } diff --git a/src/noggit/rendering/Primitives.cpp b/src/noggit/rendering/Primitives.cpp index d40aaca5..d9831113 100755 --- a/src/noggit/rendering/Primitives.cpp +++ b/src/noggit/rendering/Primitives.cpp @@ -35,18 +35,19 @@ void WireBox::draw ( glm::mat4x4 const& model_view auto points = math::box_points(min_point, max_point); - auto glmPoints = std::vector(); + /*auto glmPoints = std::vector(); - for(auto const point : points) + + for(auto const &point : points) { glmPoints.push_back(glm::vec3(point.x, point.y, point.z)); - } + }*/ wire_box_shader.uniform("model_view", model_view); wire_box_shader.uniform("projection", projection); wire_box_shader.uniform("transform", transform); wire_box_shader.uniform("color", color); - wire_box_shader.uniform("pointPositions", glmPoints); + wire_box_shader.uniform("pointPositions", points); OpenGL::Scoped::bool_setter const line_smooth; gl.hint(GL_LINE_SMOOTH_HINT, GL_NICEST);