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 --- thirdparty/openmesh/glmcompat.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 thirdparty/openmesh/glmcompat.h (limited to 'thirdparty/openmesh') 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 +#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; + }; +} -- cgit v1.2.3