summaryrefslogtreecommitdiff
path: root/lib/maths.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-31 13:42:52 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-31 13:42:52 +0000
commitbd1cbbdda889071de6eacbc9c87ef8028bccafa7 (patch)
tree10995bac76d01dfab0f331dcc9fe4cd8ed54870c /lib/maths.h
parentAdd operator-> to glRef for pointer types (diff)
downloadilt-bd1cbbdda889071de6eacbc9c87ef8028bccafa7.tar.bz2
ilt-bd1cbbdda889071de6eacbc9c87ef8028bccafa7.tar.xz
ilt-bd1cbbdda889071de6eacbc9c87ef8028bccafa7.zip
Add glm::vec concatenation operator||
Diffstat (limited to 'lib/maths.h')
-rw-r--r--lib/maths.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/maths.h b/lib/maths.h
index a75c7a8..c7b1c8f 100644
--- a/lib/maths.h
+++ b/lib/maths.h
@@ -97,6 +97,20 @@ operator!(const glm::vec2 & v)
return v ^ 0.F;
}
+template<glm::length_t L1, glm::length_t L2, typename T, glm::qualifier Q>
+inline constexpr glm::vec<L1 + L2, T, Q>
+operator||(const glm::vec<L1, T, Q> v1, const glm::vec<L2, T, Q> v2)
+{
+ return {v1, v2};
+}
+
+template<glm::length_t L, typename T, glm::qualifier Q>
+inline constexpr glm::vec<L + 1, T, Q>
+operator||(const glm::vec<L, T, Q> v1, const T v2)
+{
+ return {v1, v2};
+}
+
constexpr inline float
arc_length(const Arc & arc)
{