summaryrefslogtreecommitdiff
path: root/assetFactory
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 19:48:53 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 19:48:53 +0000
commit0a0f40c7ef055b39b061072299326a786ca0be7b (patch)
tree71b084064f9f6af86e0273cfcd1edf355d5954d6 /assetFactory
parentnodiscard in Asset factory mutation (diff)
downloadilt-0a0f40c7ef055b39b061072299326a786ca0be7b.tar.bz2
ilt-0a0f40c7ef055b39b061072299326a786ca0be7b.tar.xz
ilt-0a0f40c7ef055b39b061072299326a786ca0be7b.zip
Remove more use of legacy types from asset factory
Diffstat (limited to 'assetFactory')
-rw-r--r--assetFactory/cuboid.cpp2
-rw-r--r--assetFactory/cylinder.cpp2
-rw-r--r--assetFactory/modelFactoryMesh.h2
-rw-r--r--assetFactory/mutation.h3
-rw-r--r--assetFactory/plane.cpp2
-rw-r--r--assetFactory/shape.cpp2
-rw-r--r--assetFactory/shape.h2
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<Position3D, 8> VERTICES {{
+ static constexpr std::array<RelativePosition3D, 8> 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<float>(P);
// Generate 2D circumference points
- std::vector<Position2D> circumference(P);
+ std::vector<RelativePosition2D> 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<Position3D, 4> VERTICES {{
+ static constexpr std::array<RelativePosition3D, 4> 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<OpenMesh::VertexHandle>
-Shape::addToMesh(ModelFactoryMesh & mesh, const std::span<const Position3D> vertices)
+Shape::addToMesh(ModelFactoryMesh & mesh, const std::span<const RelativePosition3D> vertices)
{
std::vector<OpenMesh::VertexHandle> 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<OpenMesh::VertexHandle> addToMesh(
- ModelFactoryMesh & mesh, const std::span<const Position3D> vertices);
+ ModelFactoryMesh & mesh, const std::span<const RelativePosition3D> vertices);
};