From f2654cf7d46b0e55d288cc48bdd6af872fb021f4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 2 May 2021 14:44:31 +0100 Subject: Fix warnings produced by new clang-tidy --- lib/maths.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/maths.h') diff --git a/lib/maths.h b/lib/maths.h index c4c1a51..c02123a 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -56,6 +56,20 @@ float vector_pitch(const glm::vec3 & diff); float round_frac(const float & v, const float & frac); +template +inline constexpr auto +sq(T v) +{ + return v * v; +} + +template +inline constexpr auto +rdiv(Ta a, Tb b) +{ + return ((R)a / (R)b); +} + constexpr inline glm::vec2 operator!(const glm::vec3 & v) { -- cgit v1.2.3