diff options
| author | Franklin Wei <me@fwei.tk> | 2019-03-07 19:14:35 -0500 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2019-03-07 19:14:35 -0500 |
| commit | 31539f3af0c7beea865b29fdda0840c79f14710e (patch) | |
| tree | 7bea014a44a938f71ea21b3a8ba457b3576348d9 /include/fml/quat.h | |
| download | libfml-31539f3af0c7beea865b29fdda0840c79f14710e.zip libfml-31539f3af0c7beea865b29fdda0840c79f14710e.tar.gz libfml-31539f3af0c7beea865b29fdda0840c79f14710e.tar.bz2 libfml-31539f3af0c7beea865b29fdda0840c79f14710e.tar.xz | |
Import from fieldviz
Diffstat (limited to 'include/fml/quat.h')
| -rw-r--r-- | include/fml/quat.h | 28 |
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 |