-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSIMDMatrix.hpp
More file actions
70 lines (54 loc) · 1.55 KB
/
SIMDMatrix.hpp
File metadata and controls
70 lines (54 loc) · 1.55 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#ifndef SIMDMATRIX_H
#define SIMDMATRIX_H
#ifndef SIMDVECTOR_H
#include "SIMDVector.hpp"
#endif
#ifdef _WINDLL
#define CGM_DLL __declspec(dllexport)
#else
#define CGM_DLL __declspec(dllimport)
#endif
namespace cliqCity
{
namespace graphicsMath
{
struct CGM_DLL SIMDMatrix
{
union
{
float128_t m[4];
SIMDVector pRows[4];
struct
{
float128_t m0, m1, m2, m3;
};
struct
{
SIMDVector u, v, w, t;
};
};
SIMDMatrix(const SIMDMatrix& other);
SIMDMatrix(const float128_t& m0, const float128_t& m1, const float128_t& m2, const float128_t& m3);
SIMDMatrix() {};
SIMDMatrix transpose() const;
SIMDMatrix inverse() const;
float determinant() const;
SIMDMatrix operator+=(const SIMDMatrix& rhs);
SIMDMatrix operator-=(const SIMDMatrix& rhs);
SIMDMatrix operator*=(const float& rhs);
SIMDMatrix operator=(const SIMDMatrix& rhs);
SIMDMatrix operator-();
SIMDVector& operator[](const unsigned int& index);
float operator()(const unsigned int& row, const unsigned int& column);
};
// Binary (Matrix4)
CGM_DLL SIMDMatrix operator+(const SIMDMatrix& lhs, const SIMDMatrix& rhs);
CGM_DLL SIMDMatrix operator-(const SIMDMatrix& lhs, const SIMDMatrix& rhs);
CGM_DLL SIMDMatrix operator*(const SIMDMatrix& lhs, const SIMDMatrix& rhs);
CGM_DLL SIMDVector operator*(const SIMDVector& lhs, const SIMDMatrix& rhs);
CGM_DLL SIMDMatrix operator*(const SIMDMatrix& lhs, const float& rhs);
CGM_DLL SIMDMatrix operator*(const float& lhs, const SIMDMatrix& rhs);
}
}
#endif