summaryrefslogtreecommitdiff
path: root/thirdparty
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-03 21:31:54 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-03 21:31:54 +0000
commit5d9849266e11043deefdd18b4701c7e9c289f37e (patch)
treed43e7f97613dd6231b9d900758ed89e37b1851d5 /thirdparty
parentDon't request a specific OpenGL version, just check we get something sufficie... (diff)
parentImplement terrain intersect ray (diff)
downloadilt-5d9849266e11043deefdd18b4701c7e9c289f37e.tar.bz2
ilt-5d9849266e11043deefdd18b4701c7e9c289f37e.tar.xz
ilt-5d9849266e11043deefdd18b4701c7e9c289f37e.zip
Psycho-rebased branch terrain on top of main
Diffstat (limited to 'thirdparty')
-rw-r--r--thirdparty/openmesh/glmcompat.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/thirdparty/openmesh/glmcompat.h b/thirdparty/openmesh/glmcompat.h
new file mode 100644
index 0000000..708b1a6
--- /dev/null
+++ b/thirdparty/openmesh/glmcompat.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <OpenMesh/Core/Mesh/Traits.hh>
+#include <glm/geometric.hpp>
+#include <glm/vec3.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;
+ };
+}