From 715d4879fdd096ac82367984fdb22117d48737a4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 15 Feb 2023 02:26:06 +0000 Subject: First cut of the model factory and the hardcoded Brush 47 model Requires temporary change to the fragment shader to hardcode some visible colour to the model --- assetFactory/object.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 assetFactory/object.cpp (limited to 'assetFactory/object.cpp') diff --git a/assetFactory/object.cpp b/assetFactory/object.cpp new file mode 100644 index 0000000..8b70676 --- /dev/null +++ b/assetFactory/object.cpp @@ -0,0 +1,17 @@ +#include "object.h" +#include + +Object::Object(std::string i) : id {std::move(i)} { } + +Object::CreatedFaces +Object::createMesh(ModelFactoryMesh & mesh, const Mutation::Matrix & mutation) const +{ + CreatedFaces faces; + for (const auto & use : uses) { + auto useFaces = use->createMesh(mesh, mutation); + std::transform(useFaces.begin(), useFaces.end(), std::inserter(faces, faces.end()), [this](auto && face) { + return std::make_pair(id + ":" + face.first, std::move(face.second)); + }); + } + return faces; +} -- cgit v1.2.3