/* model/fragment.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #include "model/fragment.h" #include "model/vertexarray.h" namespace model { Fragment::Fragment(Type type, unsigned int material) { fragment_type = type; fragment_start = VertexArray::instance()->index(); fragment_material = material; fragment_structural_size = 0; fragment_detail_size = 0; } size_t Fragment::add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, math::Color const & color, bool detail) { size_t n = VertexArray::instance()->add_vertex(vertex, normal, color); if (detail) fragment_detail_size += n; else fragment_structural_size += n; return n; } }