-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypedefs.h
74 lines (63 loc) · 1.15 KB
/
typedefs.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
#ifndef TYPEDEFS_H
#define TYPEDEFS_H
typedef struct {
float x;
float y;
} vec2f;
typedef struct {
int x;
int y;
} vec2i;
typedef struct {
float x;
float y;
float z;
} vec3f;
typedef struct {
int x;
int y;
int z;
} vec3i;
typedef struct {
int m;
int top_bottom;
int left_right;
int L_region;
int finest;
int top_offset;
int bottom_offset;
int left_offset;
int right_offset;
} indexsize_t;
typedef enum {
DIR_UP,
DIR_DOWN,
DIR_LEFT,
DIR_RIGHT,
DIR_FORWARD,
DIR_BACKWARD,
} direction_t;
typedef enum {
INDEX_TOP = 0,
INDEX_BOTTOM = 1,
INDEX_LEFT = 2,
INDEX_RIGHT = 3,
INDEX_L_REGION = 4,
INDEX_FINEST = 5,
} index_t;
// emulate the bool type of c++
typedef enum {
false = 0,
true = 1,
} bool;
vec2i add2i(vec2i a, vec2i b);
void set3f(vec3f *c, float x, float y, float z);
vec3f copy3f(vec3f *c);
void negate3f(vec3f *c);
vec3f add3f(vec3f a, vec3f b);
vec3i add3i(vec3i a, vec3i b);
vec3f subtract3f(vec3f a, vec3f b);
float dot3f(vec3f a, vec3f b);
vec3f cross3f(vec3f a, vec3f b);
void normalize3f(vec3f *c);
#endif // TYPEDEFS_H