-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeometry.h
48 lines (36 loc) · 943 Bytes
/
geometry.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef GEOMETRY_H
#define GEOMETRY_H
#include "common.h"
#include <QVector2D>
#include <QVector3D>
#include <QVector4D>
#include <QMatrix4x4>
//using glm::vec2;
//using glm::vec3;
//using glm::vec4;
//using glm::mat4x4;
typedef QVector2D vec2;
typedef QVector3D vec3;
typedef QVector4D vec4;
typedef QMatrix4x4 mat4;
using std::ostream;
inline ostream& operator<<(ostream& os, const vec3& vec) {
os << vec.x() << " " << vec.y() << " " << vec.z();
return os;
}
inline ostream& operator<<(ostream& os, const vec4& vec) {
os << vec.x() << " " << vec.y() << " " << vec.z() << " " << vec.w();
return os;
}
//class Transform {
//public:
// mat4& matrix();
// const mat4& matrix() const;
// void setMatrix(const mat4 &matrix);
// vec3 position() const;
// void setPosition(const vec3& position);
// void translate(const vec3& trans);
//private:
// mat4 matrix_;
//};
#endif // GEOMETRY_H