summaryrefslogtreecommitdiff
path: root/maths.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-01-21 00:17:00 +1100
committerquou <quou@disroot.org>2025-01-21 00:17:00 +1100
commit3d6c0450f8a5d46dfced510bad7d0a3792c3359b (patch)
treea322850f0ae2ce156d2dd21e17ab56783d2cc0ad /maths.hpp
parenta98215feea95f3a87ead802e7815f62c83ebf77d (diff)
quaternion
Diffstat (limited to 'maths.hpp')
-rw-r--r--maths.hpp12
1 files changed, 12 insertions, 0 deletions
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 <bool normalise>
+ 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];