summaryrefslogtreecommitdiff
path: root/lib/maths.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/maths.h')
-rw-r--r--lib/maths.h9
1 files changed, 8 insertions, 1 deletions
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<typename R = float, typename Ta, typename Tb>
inline constexpr auto
-rdiv(Ta a, Tb b)
+ratio(Ta a, Tb b)
{
return (static_cast<R>(a) / static_cast<R>(b));
}
+template<typename R = float, typename T, glm::qualifier Q>
+inline constexpr auto
+ratio(glm::vec<2, T, Q> v)
+{
+ return ratio<R>(v.x, v.y);
+}
+
constexpr inline glm::vec2
operator!(const glm::vec3 & v)
{