diff options
Diffstat (limited to 'assetFactory')
-rw-r--r-- | assetFactory/cuboid.cpp | 2 | ||||
-rw-r--r-- | assetFactory/cylinder.cpp | 6 | ||||
-rw-r--r-- | assetFactory/plane.cpp | 2 | ||||
-rw-r--r-- | assetFactory/shape.cpp | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/assetFactory/cuboid.cpp b/assetFactory/cuboid.cpp index a8ddcd9..cfb6cfb 100644 --- a/assetFactory/cuboid.cpp +++ b/assetFactory/cuboid.cpp @@ -4,7 +4,7 @@ Cuboid::CreatedFaces Cuboid::createMesh(ModelFactoryMesh & mesh, float) const { - static constexpr std::array<glm::vec3, 8> VERTICES {{ + static constexpr std::array<Position3D, 8> VERTICES {{ // bottom {n, n, z}, {n, y, z}, diff --git a/assetFactory/cylinder.cpp b/assetFactory/cylinder.cpp index 7d22e36..ed034fd 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)); } diff --git a/assetFactory/plane.cpp b/assetFactory/plane.cpp index c6e1b5a..28fb690 100644 --- a/assetFactory/plane.cpp +++ b/assetFactory/plane.cpp @@ -4,7 +4,7 @@ Plane::CreatedFaces Plane::createMesh(ModelFactoryMesh & mesh, float) const { - static constexpr std::array<glm::vec3, 4> VERTICES {{ + static constexpr std::array<Position3D, 4> VERTICES {{ {n, n, z}, {y, n, z}, {y, y, z}, diff --git a/assetFactory/shape.cpp b/assetFactory/shape.cpp index 1bfbdbb..0f83ee5 100644 --- a/assetFactory/shape.cpp +++ b/assetFactory/shape.cpp @@ -1,11 +1,9 @@ #include "shape.h" -#include "gfx/models/vertex.h" -#include "maths.h" #include "modelFactoryMesh.h" #include "shape.h" std::vector<OpenMesh::VertexHandle> -Shape::addToMesh(ModelFactoryMesh & mesh, const std::span<const glm::vec3> vertices) +Shape::addToMesh(ModelFactoryMesh & mesh, const std::span<const Position3D> vertices) { std::vector<OpenMesh::VertexHandle> vhs; std::transform(vertices.begin(), vertices.end(), std::back_inserter(vhs), [&mesh](const auto & p) { |