summaryrefslogtreecommitdiff
path: root/assetFactory/assetFactoryConfig.h
diff options
context:
space:
mode:
Diffstat (limited to 'assetFactory/assetFactoryConfig.h')
-rw-r--r--assetFactory/assetFactoryConfig.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/assetFactory/assetFactoryConfig.h b/assetFactory/assetFactoryConfig.h
new file mode 100644
index 0000000..171b81a
--- /dev/null
+++ b/assetFactory/assetFactoryConfig.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "assetFactoryConfig_fwd.h"
+#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
+#include <OpenMesh/Core/Mesh/Traits.hh>
+#include <glm/geometric.hpp>
+#include <glm/vec3.hpp>
+
+namespace OpenMesh {
+ template<typename Scalar, int DIM> struct glmvec : public VectorT<Scalar, DIM> {
+ using VectorT<Scalar, DIM>::VectorT;
+ glmvec(const VectorT<Scalar, DIM> & v) : VectorT<Scalar, DIM> {v} { }
+ operator glm::vec<DIM, Scalar>() const
+ {
+ glm::vec<DIM, Scalar> out;
+ std::copy(this->begin(), this->end(), &out[0]);
+ return out;
+ }
+ };
+}
+
+struct ModelFactoryTraits : public OpenMesh::DefaultTraits {
+ FaceAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status);
+ EdgeAttributes(OpenMesh::Attributes::Status);
+ VertexAttributes(OpenMesh::Attributes::Normal | OpenMesh::Attributes::Status);
+ using Point = OpenMesh::glmvec<float, 3>;
+ using Normal = OpenMesh::glmvec<float, 3>;
+};