1 |
|
---|
2 | #ifndef CR_MATRIX_H
|
---|
3 | #define CR_MATRIX_H
|
---|
4 |
|
---|
5 | #include "chromium.h"
|
---|
6 |
|
---|
7 | #include <iprt/cdefs.h>
|
---|
8 |
|
---|
9 | /*
|
---|
10 | * Note: m[col][row] matches OpenGL's column-major memory layout
|
---|
11 | */
|
---|
12 | typedef struct {
|
---|
13 | float m00, m01, m02, m03;
|
---|
14 | float m10, m11, m12, m13;
|
---|
15 | float m20, m21, m22, m23;
|
---|
16 | float m30, m31, m32, m33;
|
---|
17 | } CRmatrix;
|
---|
18 |
|
---|
19 | typedef struct { GLfloat x,y,z,w; } GLvectorf;
|
---|
20 | typedef struct { GLdouble x,y,z,w; } GLvectord;
|
---|
21 |
|
---|
22 | #ifdef __cplusplus
|
---|
23 | extern "C" {
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | extern DECLEXPORT(void)
|
---|
27 | crMatrixInit(CRmatrix *m);
|
---|
28 |
|
---|
29 | extern DECLEXPORT(void)
|
---|
30 | crMatrixInitFromString(CRmatrix *m, const char *s);
|
---|
31 |
|
---|
32 | extern DECLEXPORT(void)
|
---|
33 | crMatrixInitFromFloats(CRmatrix *m, const float *v);
|
---|
34 |
|
---|
35 | extern DECLEXPORT(void)
|
---|
36 | crMatrixInitFromDoubles(CRmatrix *m, const double *v);
|
---|
37 |
|
---|
38 | extern DECLEXPORT(void)
|
---|
39 | crMatrixPrint(const char *msg, const CRmatrix *m);
|
---|
40 |
|
---|
41 | extern DECLEXPORT(void)
|
---|
42 | crMatrixGetFloats(float *values, const CRmatrix *m);
|
---|
43 |
|
---|
44 | extern DECLEXPORT(int)
|
---|
45 | crMatrixIsEqual(const CRmatrix *m, const CRmatrix *n);
|
---|
46 |
|
---|
47 | extern DECLEXPORT(int)
|
---|
48 | crMatrixIsIdentity(const CRmatrix *m);
|
---|
49 |
|
---|
50 | extern DECLEXPORT(int)
|
---|
51 | crMatrixIsOrthographic(const CRmatrix *m);
|
---|
52 |
|
---|
53 | extern DECLEXPORT(void)
|
---|
54 | crMatrixCopy(CRmatrix *dest, const CRmatrix *src);
|
---|
55 |
|
---|
56 | extern DECLEXPORT(void)
|
---|
57 | crMatrixMultiply(CRmatrix *p, const CRmatrix *a, const CRmatrix *b);
|
---|
58 |
|
---|
59 | extern DECLEXPORT(void)
|
---|
60 | crMatrixTransformPointf(const CRmatrix *m, GLvectorf *p);
|
---|
61 |
|
---|
62 | extern DECLEXPORT(void)
|
---|
63 | crMatrixTransformPointd(const CRmatrix *m, GLvectord *p);
|
---|
64 |
|
---|
65 | extern DECLEXPORT(void)
|
---|
66 | crMatrixInvertTranspose(CRmatrix *inv, const CRmatrix *mat);
|
---|
67 |
|
---|
68 | extern DECLEXPORT(void)
|
---|
69 | crMatrixTranspose(CRmatrix *t, const CRmatrix *m);
|
---|
70 |
|
---|
71 | extern DECLEXPORT(void)
|
---|
72 | crMatrixTranslate(CRmatrix *m, float x, float y, float z);
|
---|
73 |
|
---|
74 | extern DECLEXPORT(void)
|
---|
75 | crMatrixRotate(CRmatrix *m, float angle, float x, float y, float z);
|
---|
76 |
|
---|
77 | extern DECLEXPORT(void)
|
---|
78 | crMatrixScale(CRmatrix *m, float x, float y, float z);
|
---|
79 |
|
---|
80 | extern DECLEXPORT(void)
|
---|
81 | crMatrixFrustum(CRmatrix *m,
|
---|
82 | float left, float right,
|
---|
83 | float bottom, float top,
|
---|
84 | float zNear, float zFar);
|
---|
85 |
|
---|
86 | extern DECLEXPORT(void)
|
---|
87 | crMatrixOrtho(CRmatrix *m,
|
---|
88 | float left, float right,
|
---|
89 | float bottom, float top,
|
---|
90 | float znear, float zfar);
|
---|
91 |
|
---|
92 | #ifdef __cplusplus
|
---|
93 | }
|
---|
94 | #endif
|
---|
95 |
|
---|
96 | #endif
|
---|