TinyGL 0.4.1 for MinGW
zmath.h
Go to the documentation of this file.
1#ifndef __ZMATH__
2#define __ZMATH__
3
4/* Matrix & Vertex */
5
6typedef struct {
7 float m[4][4];
8} M4;
9
10typedef struct {
11 float m[3][3];
12} M3;
13
14typedef struct {
15 float m[3][4];
16} M34;
17
18
19#define X v[0]
20#define Y v[1]
21#define Z v[2]
22#define W v[3]
23
24typedef struct {
25 float v[3];
26} V3;
27
28typedef struct {
29 float v[4];
30} V4;
31
32void gl_M4_Id(M4 *a);
33int gl_M4_IsId(M4 *a);
34void gl_M4_Move(M4 *a,M4 *b);
35void gl_MoveV3(V3 *a,V3 *b);
36void gl_MulM4V3(V3 *a,M4 *b,V3 *c);
37void gl_MulM3V3(V3 *a,M4 *b,V3 *c);
38
39void gl_M4_MulV4(V4 * a,M4 *b,V4 * c);
40void gl_M4_InvOrtho(M4 *a,M4 b);
41void gl_M4_Inv(M4 *a,M4 *b);
42void gl_M4_Mul(M4 *c,M4 *a,M4 *b);
43void gl_M4_MulLeft(M4 *c,M4 *a);
44void gl_M4_Transpose(M4 *a,M4 *b);
45void gl_M4_Rotate(M4 *c,float t,int u);
46int gl_V3_Norm(V3 *a);
47
48V3 gl_V3_New(float x,float y,float z);
49V4 gl_V4_New(float x,float y,float z,float w);
50
51int gl_Matrix_Inv(float *r,float *m,int n);
52
53#endif __ZMATH__
Definition: zmath.h:14
Definition: zmath.h:10
Definition: zmath.h:6
Definition: zmath.h:24
Definition: zmath.h:28
register int a
Definition: zline.h:1
void gl_M4_Transpose(M4 *a, M4 *b)
Definition: zmath.c:97
void gl_M4_Rotate(M4 *c, float t, int u)
Definition: zmath.c:206
void gl_M4_MulV4(V4 *a, M4 *b, V4 *c)
Definition: zmath.c:88
void gl_M4_MulLeft(M4 *c, M4 *a)
Definition: zmath.c:45
void gl_MulM3V3(V3 *a, M4 *b, V3 *c)
Definition: zmath.c:81
void gl_MoveV3(V3 *a, V3 *b)
Definition: zmath.c:68
void gl_M4_Inv(M4 *a, M4 *b)
Definition: zmath.c:198
V3 gl_V3_New(float x, float y, float z)
Definition: zmath.c:256
void gl_M4_Move(M4 *a, M4 *b)
Definition: zmath.c:63
int gl_Matrix_Inv(float *r, float *m, int n)
void gl_M4_Mul(M4 *c, M4 *a, M4 *b)
Definition: zmath.c:32
void gl_MulM4V3(V3 *a, M4 *b, V3 *c)
Definition: zmath.c:74
void gl_M4_Id(M4 *a)
Definition: zmath.c:12
int gl_M4_IsId(M4 *a)
Definition: zmath.c:20
V4 gl_V4_New(float x, float y, float z, float w)
Definition: zmath.c:265
int gl_V3_Norm(V3 *a)
Definition: zmath.c:245
void gl_M4_InvOrtho(M4 *a, M4 b)
Definition: zmath.c:121