[4057] added: Line of sight (vmaps) [part 2] (last part)
[mangos-git.git] / contrib / vmap_extractor_v2 / vmapextract / modelheaders.h
blob54e31b3389057e26089ac67feef38bdcb3798118
1 #ifndef MODELHEADERS_H
2 #define MODELHEADERS_H
4 typedef unsigned char uint8;
5 typedef char int8;
6 typedef unsigned short uint16;
7 typedef short int16;
8 typedef unsigned int uint32;
9 typedef int int32;
11 #pragma pack(push,1)
13 struct ModelHeader {
14 char id[4];
15 uint8 version[4];
16 uint32 nameLength;
17 uint32 nameOfs;
18 uint32 type;
20 uint32 nGlobalSequences;
21 uint32 ofsGlobalSequences;
22 uint32 nAnimations;
23 uint32 ofsAnimations;
24 uint32 nC;
25 uint32 ofsC;
26 uint32 nD;
27 uint32 ofsD;
28 uint32 nBones;
29 uint32 ofsBones;
30 uint32 nF;
31 uint32 ofsF;
33 uint32 nVertices;
34 uint32 ofsVertices;
35 uint32 nViews;
36 uint32 ofsViews;
38 uint32 nColors;
39 uint32 ofsColors;
41 uint32 nTextures;
42 uint32 ofsTextures;
44 uint32 nTransparency; // H
45 uint32 ofsTransparency;
46 uint32 nI; // always unused ?
47 uint32 ofsI;
48 uint32 nTexAnims; // J
49 uint32 ofsTexAnims;
50 uint32 nK;
51 uint32 ofsK;
53 uint32 nTexFlags;
54 uint32 ofsTexFlags;
55 uint32 nY;
56 uint32 ofsY;
58 uint32 nTexLookup;
59 uint32 ofsTexLookup;
61 uint32 nTexUnitLookup; // L
62 uint32 ofsTexUnitLookup;
63 uint32 nTransparencyLookup; // M
64 uint32 ofsTransparencyLookup;
65 uint32 nTexAnimLookup;
66 uint32 ofsTexAnimLookup;
68 float floats[14];
70 uint32 nBoundingTriangles;
71 uint32 ofsBoundingTriangles;
72 uint32 nBoundingVertices;
73 uint32 ofsBoundingVertices;
74 uint32 nBoundingNormals;
75 uint32 ofsBoundingNormals;
77 uint32 nO;
78 uint32 ofsO;
79 uint32 nP;
80 uint32 ofsP;
81 uint32 nQ;
82 uint32 ofsQ;
83 uint32 nLights; // R
84 uint32 ofsLights;
85 uint32 nCameras; // S
86 uint32 ofsCameras;
87 uint32 nT;
88 uint32 ofsT;
89 uint32 nRibbonEmitters; // U
90 uint32 ofsRibbonEmitters;
91 uint32 nParticleEmitters; // V
92 uint32 ofsParticleEmitters;
96 // block B - animations
97 struct ModelAnimation {
98 uint32 animID;
99 uint32 timeStart;
100 uint32 timeEnd;
102 float moveSpeed;
104 uint32 loopType;
105 uint32 flags;
106 uint32 d1;
107 uint32 d2;
108 uint32 playSpeed; // note: this can't be play speed because it's 0 for some models
110 Vec3D boxA, boxB;
111 float rad;
113 int16 s[2];
117 // sub-block in block E - animation data
118 struct AnimationBlock {
119 int16 type; // interpolation type (0=none, 1=linear, 2=hermite)
120 int16 seq; // global sequence id or -1
121 uint32 nRanges;
122 uint32 ofsRanges;
123 uint32 nTimes;
124 uint32 ofsTimes;
125 uint32 nKeys;
126 uint32 ofsKeys;
129 // block E - bones
130 struct ModelBoneDef {
131 int32 animid;
132 int32 flags;
133 int16 parent; // parent bone index
134 int16 geoid;
135 // new int added to the bone definitions. Added in WoW 2.0
136 int32 unknown;
137 AnimationBlock translation;
138 AnimationBlock rotation;
139 AnimationBlock scaling;
140 Vec3D pivot;
143 struct ModelTexAnimDef {
144 AnimationBlock trans, rot, scale;
147 struct ModelVertex {
148 Vec3D pos;
149 uint8 weights[4];
150 uint8 bones[4];
151 Vec3D normal;
152 Vec2D texcoords;
153 int unk1, unk2; // always 0,0 so this is probably unused
156 struct ModelView {
157 uint32 nIndex, ofsIndex; // Vertices in this model (index into vertices[])
158 uint32 nTris, ofsTris; // indices
159 uint32 nProps, ofsProps; // additional vtx properties
160 uint32 nSub, ofsSub; // materials/renderops/submeshes
161 uint32 nTex, ofsTex; // material properties/textures
162 int32 lod; // LOD bias?
166 /// One material + render operation
167 struct ModelGeoset {
168 uint16 d1; // mesh part id?
169 uint16 d2; // ?
170 uint16 vstart; // first vertex
171 uint16 vcount; // num vertices
172 uint16 istart; // first index
173 uint16 icount; // num indices
174 uint16 d3; // number of bone indices
175 uint16 d4; // offset into bone index list
176 uint16 d5; // ?
177 uint16 d6; // root bone?
178 Vec3D v;
179 float unknown[4]; // Added in WoW 2.0?
182 /// A texture unit (sub of material)
183 struct ModelTexUnit{
184 // probably the texture units
185 // size always >=number of materials it seems
186 uint16 flags; // Flags
187 uint16 order; // ?
188 uint16 op; // Material this texture is part of (index into mat)
189 uint16 op2; // Always same as above?
190 int16 colorIndex; // color or -1
191 uint16 flagsIndex; // more flags...
192 uint16 texunit; // Texture unit (0 or 1)
193 uint16 d4; // ? (seems to be always 1)
194 uint16 textureid; // Texture id (index into global texture list)
195 uint16 texunit2; // copy of texture unit value?
196 uint16 transid; // transparency id (index into transparency list)
197 uint16 texanimid; // texture animation id
200 // block X - render flags
201 struct ModelRenderFlags {
202 uint16 flags;
203 uint16 blend;
206 // block G - color defs
207 struct ModelColorDef {
208 AnimationBlock color;
209 AnimationBlock opacity;
212 // block H - transp defs
213 struct ModelTransDef {
214 AnimationBlock trans;
217 struct ModelTextureDef {
218 uint32 type;
219 uint32 flags;
220 uint32 nameLen;
221 uint32 nameOfs;
224 struct ModelLightDef {
225 int16 type;
226 int16 bone;
227 Vec3D pos;
228 AnimationBlock ambColor;
229 AnimationBlock ambIntensity;
230 AnimationBlock color;
231 AnimationBlock intensity;
232 AnimationBlock attStart;
233 AnimationBlock attEnd;
234 AnimationBlock unk1;
237 struct ModelCameraDef {
238 int32 id;
239 float fov, farclip, nearclip;
240 AnimationBlock transPos;
241 Vec3D pos;
242 AnimationBlock transTarget;
243 Vec3D target;
244 AnimationBlock rot;
248 struct ModelParticleParams {
249 float mid;
250 uint32 colors[3];
251 float sizes[3];
252 int16 d[10];
253 float unk[3];
254 float scales[3];
255 float slowdown;
256 float rotation;
257 float f2[16];
260 struct ModelParticleEmitterDef {
261 int32 id;
262 int32 flags;
263 Vec3D pos;
264 int16 bone;
265 int16 texture;
266 int32 nZero1;
267 int32 ofsZero1;
268 int32 nZero2;
269 int32 ofsZero2;
270 int16 blend;
271 int16 type;
272 int16 s1;
273 int16 s2;
274 int16 cols;
275 int16 rows;
276 AnimationBlock params[10];
277 ModelParticleParams p;
278 AnimationBlock unk;
282 struct ModelRibbonEmitterDef {
283 int32 id;
284 int32 bone;
285 Vec3D pos;
286 int32 nTextures;
287 int32 ofsTextures;
288 int32 nUnknown;
289 int32 ofsUnknown;
290 AnimationBlock color;
291 AnimationBlock opacity;
292 AnimationBlock above;
293 AnimationBlock below;
294 float res, length, unk;
295 int16 s1, s2;
296 AnimationBlock unk1;
297 AnimationBlock unk2;
301 #pragma pack(pop)
304 #endif