summaryrefslogtreecommitdiff
path: root/assetFactory/cylinder.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-10 01:41:19 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-10 01:41:19 +0000
commitd9a0bcf532a44e94f11f23b910d117ec41c92ec8 (patch)
treeb988ce38d48de9ecf87d57bddabc397edeebfff3 /assetFactory/cylinder.cpp
parentInplace operator%= for vec3/mat4 mutation (diff)
downloadilt-d9a0bcf532a44e94f11f23b910d117ec41c92ec8.tar.bz2
ilt-d9a0bcf532a44e94f11f23b910d117ec41c92ec8.tar.xz
ilt-d9a0bcf532a44e94f11f23b910d117ec41c92ec8.zip
Swap messy glmvec wrapper for OpenMesh Point/Normal with real glm::vec and a custom vector_traits implementation
Simplify code previously messy as a result of the original hack.
Diffstat (limited to 'assetFactory/cylinder.cpp')
-rw-r--r--assetFactory/cylinder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/assetFactory/cylinder.cpp b/assetFactory/cylinder.cpp
index 0803369..7d22e36 100644
--- a/assetFactory/cylinder.cpp
+++ b/assetFactory/cylinder.cpp
@@ -19,7 +19,7 @@ Cylinder::createMesh(ModelFactoryMesh & mesh, float lodf) const
// Generate bottom face vertices
std::vector<OpenMesh::VertexHandle> bottom(P);
std::transform(circumference.begin(), circumference.end(), bottom.begin(), [&mesh](const auto & xy) {
- return mesh.add_vertex({xy.x, xy.y, 0.f});
+ return mesh.add_vertex(xy ^ 0.f);
});
surface.insert(mesh.add_namedFace("bottom", bottom));
}
@@ -27,7 +27,7 @@ Cylinder::createMesh(ModelFactoryMesh & mesh, float lodf) const
// Generate top face vertices
std::vector<OpenMesh::VertexHandle> top(P);
std::transform(circumference.rbegin(), circumference.rend(), top.begin(), [&mesh](const auto & xy) {
- return mesh.add_vertex({xy.x, xy.y, 1.f});
+ return mesh.add_vertex(xy ^ 1);
});
surface.insert(mesh.add_namedFace("top", top));
}
@@ -35,7 +35,7 @@ Cylinder::createMesh(ModelFactoryMesh & mesh, float lodf) const
// Generate edge vertices
std::vector<std::pair<OpenMesh::VertexHandle, OpenMesh::VertexHandle>> edge(P + 1);
std::transform(circumference.begin(), circumference.end(), edge.begin(), [&mesh](const auto & xy) {
- return std::make_pair(mesh.add_vertex({xy.x, xy.y, 0.f}), mesh.add_vertex({xy.x, xy.y, 1.f}));
+ return std::make_pair(mesh.add_vertex(xy ^ 0), mesh.add_vertex(xy ^ 1));
});
// Wrap around
edge.back() = edge.front();