-
Notifications
You must be signed in to change notification settings - Fork 0
/
bounder.h
75 lines (65 loc) · 1.8 KB
/
bounder.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 __BOUNDER_H__
#define __BOUNDER_H__
#define MAX_PHYS_PROXY (32)
//Structs
typedef struct {
////////////////////////////////////////////
// Pre-matrix section
// The following four arrays complete the 3D matrix representing the object's orientation and position.
////////////////////////////////////////////
//Positive orientation angles
FIXED UVX[XYZ];
FIXED UVY[XYZ];
FIXED UVZ[XYZ];
//The boxes center [XYZ]
FIXED pos[XYZ];
////////////////////////////////////////////
//Negative orientation angles
FIXED UVNX[XYZ];
FIXED UVNY[XYZ];
FIXED UVNZ[XYZ];
//The center-faces.
FIXED Xplus[XYZ];
FIXED Xneg[XYZ];
FIXED Yplus[XYZ];
FIXED Yneg[XYZ];
FIXED Zplus[XYZ];
FIXED Zneg[XYZ];
//Velocities of the various center-faces & box.
//
FIXED prevPos[XYZ];
FIXED velocity[XYZ];
//The box' radius
FIXED radius[XYZ];
//The box' rotation (expressed as ANGLE type data)
ANGLE rot[XYZ];
//Three separate flags to tell the engine if the box is populated, and ready to ..
// [0] == 'R', render, [1] == 'C', collide, [2] == 'L', light.
char status[3];
//ID
short boxID;
} _boundBox;
typedef struct {
int x_location;
int y_location;
int z_location;
short x_rotation;
short y_rotation;
short z_rotation;
int x_radius;
int y_radius;
int z_radius;
_boundBox * modified_box;
} _object_arguments;
extern _object_arguments bound_box_starter;
extern _boundBox BoundBoxHost[MAX_PHYS_PROXY];
extern _boundBox * RBBs;
extern _boundBox pl_RBB;
//------------------------------------------------------------------------------------
//FUNCTION SECTIONS FOR VARIOUS FILES
//------------------------------------------------------------------------------------
void makeBoundBox(_object_arguments * source_data);
void make2AxisBox(_object_arguments * source_data);
void initBoxes(void);
void flush_boxes(int start);
#endif