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