summaryrefslogtreecommitdiff
path: root/lib/maths.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/maths.h')
-rw-r--r--lib/maths.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/maths.h b/lib/maths.h
index c651af5..d4bcd16 100644
--- a/lib/maths.h
+++ b/lib/maths.h
@@ -125,6 +125,13 @@ operator||(const glm::vec<L, T, Q> v1, const T v2)
return {v1, v2};
}
+inline glm::vec3
+operator%(const glm::vec3 & p, const glm::mat4 & mutation)
+{
+ const auto p2 = mutation * (p ^ 1);
+ return p2 / p2.w;
+}
+
constexpr inline float
arc_length(const Arc & arc)
{