diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/maths.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/maths.h b/lib/maths.h index 67b2a15..cf369a7 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -67,6 +67,17 @@ sq(T v) return v * v; } +template<std::integral T, glm::qualifier Q> +inline constexpr glm::vec<3, T, Q> +crossInt(const glm::vec<3, T, Q> a, const glm::vec<3, T, Q> b) +{ + return { + (a.y * b.z) - (a.z * b.y), + (a.z * b.x) - (a.x * b.z), + (a.x * b.y) - (a.y * b.x), + }; +} + template<typename R = float, typename Ta, typename Tb> inline constexpr auto ratio(Ta a, Tb b) |