diff options
| author | Franklin Wei <me@fwei.tk> | 2019-02-11 12:52:45 -0500 |
|---|---|---|
| committer | Franklin Wei <me@fwei.tk> | 2019-02-11 12:52:45 -0500 |
| commit | 291bd26fd8920831181e8207e1fcdf544cd6cd6f (patch) | |
| tree | 58fc7bac5b018197590af66727ea71e11d00a737 /src/quat.h | |
| parent | 8f49ddea98f32dd8e90416012c264d8cc5501bb0 (diff) | |
| download | fieldviz-291bd26fd8920831181e8207e1fcdf544cd6cd6f.zip fieldviz-291bd26fd8920831181e8207e1fcdf544cd6cd6f.tar.gz fieldviz-291bd26fd8920831181e8207e1fcdf544cd6cd6f.tar.bz2 fieldviz-291bd26fd8920831181e8207e1fcdf544cd6cd6f.tar.xz | |
Reorganize, use readline
Diffstat (limited to 'src/quat.h')
| -rw-r--r-- | src/quat.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quat.h b/src/quat.h new file mode 100644 index 0000000..5821f81 --- /dev/null +++ b/src/quat.h @@ -0,0 +1,25 @@ +#ifndef QUAT_H +#define QUAT_H +#include "vec3.h" +#include <iostream> + +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 |