X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fshape.cpp;h=3d6f4420833efba99231876f13e8adbfaf78bf9f;hb=b4995967309bf5570161db2287e27b84ca94ab9a;hp=c96a07422d6c8407721010449c182b3798169857;hpb=a58c4558e7d4934f4d0ee621520acfe1c8258c93;p=blank.git diff --git a/src/shape.cpp b/src/shape.cpp index c96a074..3d6f442 100644 --- a/src/shape.cpp +++ b/src/shape.cpp @@ -19,6 +19,24 @@ void Shape::Vertices( } } +void Shape::Vertices( + Model::Positions &vertex, + Model::Normals &normal, + Model::Indices &index, + const glm::mat4 &transform, + Model::Index idx_offset +) const { + for (const auto &pos : vtx_pos) { + vertex.emplace_back(transform * glm::vec4(pos, 1.0f)); + } + for (const auto &nrm : vtx_nrm) { + normal.emplace_back(transform * glm::vec4(nrm, 0.0f)); + } + for (auto idx : vtx_idx) { + index.emplace_back(idx_offset + idx); + } +} + void Shape::Outline( OutlineModel::Positions &vertex, OutlineModel::Indices &index,