diff options
Diffstat (limited to 'assetFactory/cylinder.cpp')
-rw-r--r-- | assetFactory/cylinder.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/assetFactory/cylinder.cpp b/assetFactory/cylinder.cpp index 7d22e36..58980cf 100644 --- a/assetFactory/cylinder.cpp +++ b/assetFactory/cylinder.cpp @@ -9,8 +9,8 @@ Cylinder::createMesh(ModelFactoryMesh & mesh, float lodf) const const auto step = two_pi / static_cast<float>(P); // Generate 2D circumference points - std::vector<glm::vec2> circumference(P); - std::generate(circumference.begin(), circumference.end(), [a = 0.f, step]() mutable { + std::vector<Position2D> circumference(P); + std::generate(circumference.begin(), circumference.end(), [a = 0.F, step]() mutable { return sincosf(a += step) * .5F; }); @@ -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 ^ 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 ^ 1); + return mesh.add_vertex(xy || 1.F); }); 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 ^ 0), mesh.add_vertex(xy ^ 1)); + return std::make_pair(mesh.add_vertex(xy || 0.F), mesh.add_vertex(xy || 1.F)); }); // Wrap around edge.back() = edge.front(); |