diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-02-15 02:26:06 +0000 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2023-02-15 11:34:11 +0000 |
commit | 715d4879fdd096ac82367984fdb22117d48737a4 (patch) | |
tree | 576b0553b10795bb51384ba4c47269d4226bdca6 /assetFactory/shape.cpp | |
parent | Add OpenMeshCore library (diff) | |
download | ilt-715d4879fdd096ac82367984fdb22117d48737a4.tar.bz2 ilt-715d4879fdd096ac82367984fdb22117d48737a4.tar.xz ilt-715d4879fdd096ac82367984fdb22117d48737a4.zip |
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
Diffstat (limited to 'assetFactory/shape.cpp')
-rw-r--r-- | assetFactory/shape.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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<OpenMesh::VertexHandle> +Shape::addMutatedToMesh( + ModelFactoryMesh & mesh, const std::span<const glm::vec3> vertices, const Mutation::Matrix & mutation) +{ + std::vector<OpenMesh::VertexHandle> 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; +} |