From 6ec18905acdb9b30e5bfc5eee9be0182ce1744c9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 26 Oct 2023 20:34:55 +0100 Subject: Move OpenMesh/GLM compatibility structs to common place --- assetFactory/modelFactoryMesh.h | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'assetFactory/modelFactoryMesh.h') diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h index 32e7ab5..2129fb5 100644 --- a/assetFactory/modelFactoryMesh.h +++ b/assetFactory/modelFactoryMesh.h @@ -2,36 +2,11 @@ #include "modelFactoryMesh_fwd.h" #include -#include #include -#include #include #include #include - -namespace glm { - template - auto - norm(const vec & v) - { - return length(v); - } - - template - auto - vectorize(vec & v, S scalar) - { - v = vec {static_cast(scalar)}; - } -} - -namespace OpenMesh { - template struct vector_traits> { - using vector_type = glm::vec; - using value_type = T; - static constexpr glm::length_t size_ = L; - }; -} +#include struct ModelFactoryTraits : public OpenMesh::DefaultTraits { FaceAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status | OpenMesh::Attributes::Color); -- cgit v1.2.3 From d771fbda2c171cfbc36cc0eb3122c1a02ffbb081 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 9 Nov 2023 01:57:27 +0000 Subject: WIP typedefing just about everything else --- assetFactory/modelFactoryMesh.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'assetFactory/modelFactoryMesh.h') diff --git a/assetFactory/modelFactoryMesh.h b/assetFactory/modelFactoryMesh.h index 32e7ab5..480bf7f 100644 --- a/assetFactory/modelFactoryMesh.h +++ b/assetFactory/modelFactoryMesh.h @@ -1,5 +1,6 @@ #pragma once +#include "config/types.h" #include "modelFactoryMesh_fwd.h" #include #include @@ -38,10 +39,10 @@ struct ModelFactoryTraits : public OpenMesh::DefaultTraits { 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 { -- cgit v1.2.3