From ba770a85b2b0ff9222e2867689c693ebee841e55 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 18 Nov 2022 20:39:54 +0000 Subject: Rename rdiv to ratio and add a vec2 override --- lib/maths.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/maths.h b/lib/maths.h index 514a5ad..1c07baa 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -67,11 +67,18 @@ sq(T v) template inline constexpr auto -rdiv(Ta a, Tb b) +ratio(Ta a, Tb b) { return (static_cast(a) / static_cast(b)); } +template +inline constexpr auto +ratio(glm::vec<2, T, Q> v) +{ + return ratio(v.x, v.y); +} + constexpr inline glm::vec2 operator!(const glm::vec3 & v) { -- cgit v1.2.3