From 3d6c0450f8a5d46dfced510bad7d0a3792c3359b Mon Sep 17 00:00:00 2001 From: quou Date: Tue, 21 Jan 2025 00:17:00 +1100 Subject: quaternion --- maths.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'maths.hpp') diff --git a/maths.hpp b/maths.hpp index 98a318f..e9b2fa8 100644 --- a/maths.hpp +++ b/maths.hpp @@ -469,6 +469,18 @@ struct AABB { v3f min, max; }; +namespace quat { + v4f identity(); + v4f scale(const v4f& q, float s); + v4f normalised(const v4f& q); + v4f conjugate(const v4f& q); + template + v4f mul(const v4f& a, const v4f& b); + v4f mul(const v4f& a, const v4f& b); + v4f rotate(float angle, const v3f& axis); + v4f euler(const v3f& a); +} + struct m4f { float m[4][4]; -- cgit v1.2.3-54-g00ecf