From 31539f3af0c7beea865b29fdda0840c79f14710e Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 7 Mar 2019 19:14:35 -0500 Subject: Import from fieldviz --- include/fml/quat.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 include/fml/quat.h (limited to 'include/fml/quat.h') 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 + +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 -- cgit v1.1