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/shape.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 assetFactory/shape.cpp (limited to 'assetFactory/shape.cpp') diff --git a/assetFactory/shape.cpp b/assetFactory/shape.cpp new file mode 100644 index 0000000..0994898 --- /dev/null +++ b/assetFactory/shape.cpp @@ -0,0 +1,17 @@ +#include "shape.h" +#include "assetFactoryConfig.h" +#include "gfx/models/vertex.hpp" +#include "maths.h" +#include "shape.h" + +std::vector +Shape::addMutatedToMesh( + ModelFactoryMesh & mesh, const std::span vertices, const Mutation::Matrix & mutation) +{ + std::vector vhs; + std::transform(vertices.begin(), vertices.end(), std::back_inserter(vhs), [&mesh, &mutation](const auto & v) { + const auto p = v % mutation; + return mesh.add_vertex({p.x, p.y, p.z}); + }); + return vhs; +} -- cgit v1.2.3 From c22c676dfee583bd48e1f962378f580f8310838b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 16 Feb 2023 23:54:22 +0000 Subject: Refactor so ModelFactoryMesh can define the smooth property on faces --- assetFactory/shape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'assetFactory/shape.cpp') diff --git a/assetFactory/shape.cpp b/assetFactory/shape.cpp index 0994898..f6e55e8 100644 --- a/assetFactory/shape.cpp +++ b/assetFactory/shape.cpp @@ -1,7 +1,7 @@ #include "shape.h" -#include "assetFactoryConfig.h" #include "gfx/models/vertex.hpp" #include "maths.h" +#include "modelFactoryMesh.h" #include "shape.h" std::vector -- cgit v1.2.3