From cef74c920dfce3774ce84ee7629c761777445f8d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 10 Mar 2023 01:39:17 +0000 Subject: Inplace operator%= for vec3/mat4 mutation --- lib/maths.h | 6 ++++++ 1 file changed, 6 insertions(+) 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) { -- cgit v1.2.3