diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-01 17:56:26 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-01-01 17:56:26 +0000 |
commit | d5cdbbf38380239524e351cb69aec94090884ca5 (patch) | |
tree | 5d7dff2f2775701069806eceb4eaef23b22eba3f /assetFactory/modelFactoryMesh.h | |
parent | Reformat with new clang-format (diff) | |
parent | Remove more use of legacy types (diff) | |
download | ilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.bz2 ilt-d5cdbbf38380239524e351cb69aec94090884ca5.tar.xz ilt-d5cdbbf38380239524e351cb69aec94090884ca5.zip |
Merge remote-tracking branch 'origin/terrain'
Diffstat (limited to 'assetFactory/modelFactoryMesh.h')
-rw-r--r-- | assetFactory/modelFactoryMesh.h | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h index 32e7ab5..06fd7b8 100644 --- a/assetFactory/modelFactoryMesh.h +++ b/assetFactory/modelFactoryMesh.h @@ -1,47 +1,23 @@ #pragma once +#include "config/types.h" #include "modelFactoryMesh_fwd.h" #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> -#include <OpenMesh/Core/Mesh/Traits.hh> #include <glad/gl.h> -#include <glm/geometric.hpp> #include <glm/vec2.hpp> #include <glm/vec3.hpp> #include <glm/vec4.hpp> - -namespace glm { - template<length_t L, typename T, qualifier Q> - auto - norm(const vec<L, T, Q> & v) - { - return length(v); - } - - template<length_t L, typename T, qualifier Q, typename S> - auto - vectorize(vec<L, T, Q> & v, S scalar) - { - v = vec<L, T, Q> {static_cast<T>(scalar)}; - } -} - -namespace OpenMesh { - template<glm::length_t L, typename T, glm::qualifier Q> struct vector_traits<glm::vec<L, T, Q>> { - using vector_type = glm::vec<L, T, Q>; - using value_type = T; - static constexpr glm::length_t size_ = L; - }; -} +#include <thirdparty/openmesh/glmcompat.h> struct ModelFactoryTraits : public OpenMesh::DefaultTraits { FaceAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status | OpenMesh::Attributes::Color); EdgeAttributes(OpenMesh::Attributes::Status); VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status); HalfedgeAttributes(OpenMesh::Attributes::TexCoord2D); - using Point = glm::vec3; - using Normal = glm::vec3; - using Color = glm::vec4; - using TexCoord2D = glm::vec2; + using Point = Position3D; + using Normal = Normal3D; + using Color = RGBA; + using TexCoord2D = TextureRelCoord; }; struct ModelFactoryMesh : public OpenMesh::PolyMesh_ArrayKernelT<ModelFactoryTraits> { |