aboutsummaryrefslogtreecommitdiff
path: root/include/fml/quat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/fml/quat.h')
-rw-r--r--include/fml/quat.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/fml/quat.h b/include/fml/quat.h
new file mode 100644
index 0000000..14c966e
--- /dev/null
+++ b/include/fml/quat.h
@@ -0,0 +1,28 @@
+#ifndef QUAT_H
+#define QUAT_H
+
+#include "fml.h"
+#include <iostream>
+
+namespace fml {
+ class quat {
+ public:
+ scalar w, x, y, z;
+ public:
+ quat(scalar w, scalar x, scalar y, scalar z);
+ quat(scalar x, scalar y, scalar z);
+ quat(scalar w, vec3 vec);
+ quat(vec3 vec);
+ quat();
+
+ operator vec3();
+
+ quat conjugate() const;
+
+ static quat from_angleaxis(scalar angle, vec3 axis);
+ };
+
+ quat operator*(const quat &, const quat &);
+ std::ostream &operator<<(std::ostream &os, const quat &);
+}
+#endif