summaryrefslogtreecommitdiff
path: root/assetFactory/factoryMesh.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-02-24 19:30:30 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-02-24 19:30:30 +0000
commit7d0decccaac3aa564b549d91a36279e7aca0814e (patch)
tree749ceff26556ed201a055b8d8a70636b50c562f7 /assetFactory/factoryMesh.cpp
parentSupport for model colours mixed with textures (diff)
downloadilt-7d0decccaac3aa564b549d91a36279e7aca0814e.tar.bz2
ilt-7d0decccaac3aa564b549d91a36279e7aca0814e.tar.xz
ilt-7d0decccaac3aa564b549d91a36279e7aca0814e.zip
Support for recursive colouring of asset factory faces
Updates colours in sample model.
Diffstat (limited to 'assetFactory/factoryMesh.cpp')
-rw-r--r--assetFactory/factoryMesh.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/assetFactory/factoryMesh.cpp b/assetFactory/factoryMesh.cpp
index 0fb72ad..0cfed85 100644
--- a/assetFactory/factoryMesh.cpp
+++ b/assetFactory/factoryMesh.cpp
@@ -21,10 +21,12 @@ FactoryMesh::createMesh() const
std::vector<Vertex> vertices;
for (const auto & face : mesh.faces()) {
const auto smooth = mesh.property(mesh.smoothFaceProperty, face);
+ const auto colour = mesh.color(face);
for (const auto & vertex : mesh.fv_range(face)) {
vertices.emplace_back(mesh.point(vertex), NullUV,
smooth ? mesh.property(mesh.vertex_normals_pph(), vertex)
- : mesh.property(mesh.face_normals_pph(), face));
+ : mesh.property(mesh.face_normals_pph(), face),
+ colour);
}
}
return std::make_shared<Mesh>(vertices, vectorOfN(vertices.size()));