geometry.h
650 Bytes
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
/* geometry.h */
#define DEG2RAD( a) (a*(float)(3.141/180.))
/*
* Clip codes, assuming x,y,z,w is on VU 0,1,2,3
*/
#define CLIP_PLANE 6
#define CLIP_LEFT 0x1
#define CLIP_RIGHT 0x2
#define CLIP_BOTTOM 0x4
#define CLIP_TOP 0x8
#define CLIP_NEAR 0x10
#define CLIP_FAR 0x20
struct Transform {
float sx;
float sy;
float sz;
float rx;
float ry;
float rz;
float tx;
float ty;
float tz;
} ;
struct Matrix {
float m[4][4];
} ;
struct Image_space {
float sx;
float sy;
float sz;
float tx;
float ty;
float tz;
};
struct Projection {
float l;
float r;
float b;
float t;
float n;
float f;
};