summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-10 01:39:17 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-10 01:39:17 +0000
commitcef74c920dfce3774ce84ee7629c761777445f8d (patch)
tree1b8d6588589b166fc203f584be643b4fd64bf364
parentMutation persists its own members (diff)
downloadilt-cef74c920dfce3774ce84ee7629c761777445f8d.tar.bz2
ilt-cef74c920dfce3774ce84ee7629c761777445f8d.tar.xz
ilt-cef74c920dfce3774ce84ee7629c761777445f8d.zip
Inplace operator%= for vec3/mat4 mutation
-rw-r--r--lib/maths.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/maths.h b/lib/maths.h
index d4bcd16..b95b706 100644
--- a/lib/maths.h
+++ b/lib/maths.h
@@ -132,6 +132,12 @@ operator%(const glm::vec3 & p, const glm::mat4 & mutation)
return p2 / p2.w;
}
+inline glm::vec3
+operator%=(glm::vec3 & p, const glm::mat4 & mutation)
+{
+ return p = p % mutation;
+}
+
constexpr inline float
arc_length(const Arc & arc)
{