-
Notifications
You must be signed in to change notification settings - Fork 1
/
PXMatrix.h
119 lines (95 loc) · 4.31 KB
/
PXMatrix.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#ifndef PXMatrixINCLUDE
#define PXMatrixINCLUDE
#include <Media/PXType.h>
#include <Math/PXVector.h>
#define XAxisX 0
#define XAxisY 4
#define XAxisZ 8
#define XAxisW 12
#define YAxisX 1
#define YAxisY 5
#define YAxisZ 9
#define YAxisW 13
#define ZAxisX 2
#define ZAxisY 6
#define ZAxisZ 10
#define ZAxisW 14
#define WAxisX 3
#define WAxisY 7
#define WAxisZ 11
#define WAxisW 15
#define ScaleX 0
#define ScaleY 5
#define ScaleZ 10
#define ScaleW 15
#define TransformX 12
#define TransformY 13
#define TransformZ 14
#define TransformW 15
typedef struct PXRectangleOffset_ PXRectangleOffset;
/*
+----+----+----+----+
| XA | YA | ZA | Or |
+----+----+----+----+
| 0 | 1 | 2 | 3 |
| 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 |
+----+----+----+----+
*/
typedef struct PXMatrix4x4F_
{
union
{
struct
{
float XX;
float XY;
float XZ;
float XW;
float YX;
float YY;
float YZ;
float YW;
float ZX;
float ZY;
float ZZ;
float ZW;
float WX;
float WY;
float WZ;
float WW;
};
float Data[16];
float DataXY[4][4];
};
}
PXMatrix4x4F;
PXPublic void PXAPI PXMatrix4x4FIdentity(PXMatrix4x4F* const matrix4x4F);
PXPublic void PXAPI PXMatrix4x4FResetAxisW(PXMatrix4x4F* const matrix4x4F);
PXPublic void PXAPI PXMatrix4x4FPositionGet(const PXMatrix4x4F* const matrix, PXVector3F* const position);
PXPublic void PXAPI PXMatrix4x4FPositionSet(PXMatrix4x4F* const matrix4x4F, const PXVector3F* const position);
PXPublic void PXAPI PXMatrix4x4FRotationGet(const PXMatrix4x4F* const matrix, PXVector3F* const position);
PXPublic void PXAPI PXMatrix4x4FRotationSet(PXMatrix4x4F* const matrix4x4F, const PXVector3F* const position);
PXPublic void PXAPI PXMatrix4x4FRotationMatrixGenerate(PXMatrix4x4F* const matrix4x4F, PXVector3F* const position);
PXPublic void PXAPI PXMatrix4x4FMultiply(const PXMatrix4x4F* matrixA, const PXMatrix4x4F* matrixB, PXMatrix4x4F* const matrixResult);
PXPublic void PXAPI PXMatrix4x4FRotate(PXMatrix4x4F* const matrix4x4F, const PXVector3F* const vector3F);
PXPublic void PXAPI PXMatrix4x4FCopy(const PXMatrix4x4F* const matrixA, PXMatrix4x4F* const matrixResult);
PXPublic void PXAPI PXMatrix4x4FMove3F(PXMatrix4x4F* const matrixData, const PXVector3F* const vector3F);
PXPublic void PXAPI PXMatrix4x4FMoveXY(PXMatrix4x4F* const matrixData, const float x, const float y);
PXPublic void PXAPI PXMatrix4x4FMoveToScaleXY(PXMatrix4x4F* const matrixData, const float x, const float y);
PXPublic void PXAPI PXMatrix4x4FMoveXYZ(PXMatrix4x4F* const matrixData, const float x, const float y, const float z);
PXPublic void PXAPI PXMatrix4x4FScaleBy(PXMatrix4x4F* const matrixA, const float scalar);
PXPublic void PXAPI PXMatrix4x4FScaleByMargin(PXMatrix4x4F* const pxMatrix4x4F, const PXRectangleOffset* const pxMargin);
PXPublic void PXAPI PXMatrix4x4FScaleByXY(PXMatrix4x4F* const pxMatrix4x4F, const float x, const float y);
PXPublic void PXAPI PXMatrix4x4FScaleSet(PXMatrix4x4F* const pxMatrix4x4F, const PXVector3F* const pxVector3F);
PXPublic void PXAPI PXMatrix4x4FScaleSetXY(PXMatrix4x4F* const pxMatrix4x4F, const float x, const float y);
PXPublic void PXAPI PXMatrix4x4FScaleSetXYZ(PXMatrix4x4F* const pxMatrix4x4F, const float x, const float y, const float z);
PXPublic void PXAPI PXMatrix4x4FScaleGet(const PXMatrix4x4F* const matrixResult, PXVector3F* const pxVector3F);
PXPublic void PXAPI PXMatrix4x4FScaleGetXYZ(const PXMatrix4x4F* const matrixResult, float* const x, float* const y, float* const z);
PXPublic void PXAPI PXMatrix4x4FOrthographic(PXMatrix4x4F* const matrix4x4F, const float left, const float right, const float bottom, const float top, const float nearPlane, const float farPlane);
PXPublic void PXAPI PXMatrix4x4FPerspective(PXMatrix4x4F* const matrix4x4F, const float fielfOfView, const float aspectRatio, const float nearPlane, const float farPlane);
PXPublic PXBool PXAPI PXMatrix4x4FInverse(PXMatrix4x4F* const matrix4x4F);
PXPublic void PXAPI PXMatrix4x4FTranpose(PXMatrix4x4F* const matrix4x4F);
PXPublic void PXAPI PXMatrix4x4FLookAt(PXMatrix4x4F* const matrix4x4F, const PXVector3F* const eye, const PXVector3F* const center, const PXVector3F* const up);
#endif