aboutsummaryrefslogtreecommitdiff
path: root/src/quat.h
blob: 5821f8187c87c12ede6fbf635ac2103a4c3c3e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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