From 0a0f40c7ef055b39b061072299326a786ca0be7b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 1 Jan 2024 19:48:53 +0000 Subject: Remove more use of legacy types from asset factory --- assetFactory/cuboid.cpp | 2 +- assetFactory/cylinder.cpp | 2 +- assetFactory/modelFactoryMesh.h | 2 +- assetFactory/mutation.h | 3 ++- assetFactory/plane.cpp | 2 +- assetFactory/shape.cpp | 2 +- assetFactory/shape.h | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/assetFactory/cuboid.cpp b/assetFactory/cuboid.cpp index cfb6cfb..1019830 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 VERTICES {{ + static constexpr std::array VERTICES {{ // bottom {n, n, z}, {n, y, z}, diff --git a/assetFactory/cylinder.cpp b/assetFactory/cylinder.cpp index 58980cf..29c09b0 100644 --- a/assetFactory/cylinder.cpp +++ b/assetFactory/cylinder.cpp @@ -9,7 +9,7 @@ Cylinder::createMesh(ModelFactoryMesh & mesh, float lodf) const const auto step = two_pi / static_cast(P); // Generate 2D circumference points - std::vector circumference(P); + std::vector circumference(P); std::generate(circumference.begin(), circumference.end(), [a = 0.F, step]() mutable { return sincosf(a += step) * .5F; }); diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h index 06fd7b8..299986e 100644 --- a/assetFactory/modelFactoryMesh.h +++ b/assetFactory/modelFactoryMesh.h @@ -14,7 +14,7 @@ struct ModelFactoryTraits : public OpenMesh::DefaultTraits { EdgeAttributes(OpenMesh::Attributes::Status); VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status); HalfedgeAttributes(OpenMesh::Attributes::TexCoord2D); - using Point = Position3D; + using Point = RelativePosition3D; using Normal = Normal3D; using Color = RGBA; using TexCoord2D = TextureRelCoord; diff --git a/assetFactory/mutation.h b/assetFactory/mutation.h index 20fe440..4fa7e01 100644 --- a/assetFactory/mutation.h +++ b/assetFactory/mutation.h @@ -11,9 +11,10 @@ struct Mutation { [[nodiscard]] Matrix getMatrix() const; [[nodiscard]] Matrix getDeformationMatrix() const; [[nodiscard]] Matrix getLocationMatrix() const; + [[nodiscard]] float relativeLevelOfDetail() const; - Position3D position {}; + RelativePosition3D position {}; Rotation3D rotation {}; Scale3D scale {1}; diff --git a/assetFactory/plane.cpp b/assetFactory/plane.cpp index 28fb690..e8847a2 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 VERTICES {{ + static constexpr std::array VERTICES {{ {n, n, z}, {y, n, z}, {y, y, z}, diff --git a/assetFactory/shape.cpp b/assetFactory/shape.cpp index 0f83ee5..9aaae05 100644 --- a/assetFactory/shape.cpp +++ b/assetFactory/shape.cpp @@ -3,7 +3,7 @@ #include "shape.h" std::vector -Shape::addToMesh(ModelFactoryMesh & mesh, const std::span vertices) +Shape::addToMesh(ModelFactoryMesh & mesh, const std::span vertices) { std::vector vhs; std::transform(vertices.begin(), vertices.end(), std::back_inserter(vhs), [&mesh](const auto & p) { diff --git a/assetFactory/shape.h b/assetFactory/shape.h index 136e24f..2c2e702 100644 --- a/assetFactory/shape.h +++ b/assetFactory/shape.h @@ -22,5 +22,5 @@ public: virtual CreatedFaces createMesh(ModelFactoryMesh &, float levelOfDetailFactor) const = 0; static std::vector addToMesh( - ModelFactoryMesh & mesh, const std::span vertices); + ModelFactoryMesh & mesh, const std::span vertices); }; -- cgit v1.2.3