-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatrix4.h
51 lines (36 loc) · 1.17 KB
/
Matrix4.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
49
50
51
#ifndef MATRIX4_H
#define MATRIX4_H
#include <string>
#include <sstream>
#include "Vector4.h"
class Vector3;
class Matrix4
{
public:
mutable Vector4 c0, c1, c2, c3; // Matrix columns from left to right
Matrix4();
Matrix4(float a);
Matrix4(const glm::mat4 &m);
Matrix4(const Vector4 &col0,
const Vector4 &col1,
const Vector4 &col2,
const Vector4 &col3);
Matrix4 Inversed() const;
Matrix4 Transposed() const;
float *GetFirstAddress() const;
void SetScale(const Vector3 &scale);
glm::mat4 ToGlmMat4() const;
std::string ToString() const;
static Matrix4 Perspective(float fovY, float aspect,
float zNear, float zFar);
static Matrix4 Ortho(float left, float right,
float bottom, float top,
float zNear, float zFar);
static Matrix4 TranslateMatrix(const Vector3 &v);
static Matrix4 RotateMatrix(const Quaternion &q);
static Matrix4 ScaleMatrix(const Vector3 &v);
Vector4& operator[](int i) const;
static Matrix4 Identity;
};
Matrix4 operator*(const Matrix4 &m1, const Matrix4& m2);
#endif // MATRIX4_H