-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathModel.h
129 lines (102 loc) · 1.72 KB
/
Model.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#ifndef MODEL_H
#define MODEL_H
class VERTEX
{
public:
float mX, mY, mZ;
short mBone;
short mShow;
};
class NORM
{
public:
float n[3];
inline NORM& operator+= (const NORM& norm)
{
for (int i=0; i<3; i++)
n[i] += norm.n[i];
return *this;
}
inline NORM& operator/= (float scalar)
{
for (int i=0; i<3; i++)
n[i] /= scalar;
return *this;
}
};
class TRIANGLE
{
public:
//--Triangle
int v1,v2,v3;
int tx1,tx2,tx3,ty1,ty2,ty3;
int flags,u1;
int parent;
// Triangle data? (from 3D Designer)
int u2,u3,u4,u5;
};
class BONE
{
public:
char name[32];
float x;
float y;
float z;
short parent;
short unknown;
};
class TVtl
{
public:
//--Animation
char Name[32];
int KPS;
int FrameCount;
short* Data;
TVtl(){ Data = 0; }
~TVtl(){ if (Data) delete [] Data; }
};
class SOUND
{
public:
char Name[32];
int len;
BYTE *data;
SOUND() { data = 0; }
~SOUND() { if ( data ) delete [] data; }
};
class OBJ
{
public:
int Radius;
int YLo, YHi;
int linelenght, lintensity;
int circlerad, cintensity;
int flags;
int GrRad;
int DefLight;
int LastAniTime;
float BoundR;
unsigned char res[16];
};
class MODEL_HEADER
{
public:
MODEL_HEADER(){}
~MODEL_HEADER(){}
//--Character header
OBJ oInfo;
char name[24];
char msc[8];
long num_anims;
long num_sounds;
long num_verts;
long num_tris;
long num_bones;
long bytes_tex;
VERTEX mVertices[MAX_VERTICES];
TRIANGLE mFaces[MAX_TRIANGLES];
BONE mBones[32];
int AnimFX[64];
};
#endif