WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
modelheaders.h
Go to the documentation of this file.
1#pragma once
2
3#pragma pack(push,1)
4
5#include <cstdint>
6#include "glm/glm.hpp"
7#include "types.h" // unit8, etC.
8
10struct Vertex
11{
12 float tu, tv;
13 float x, y, z;
14};
15
17struct Sphere
18{
19 /*0x00*/
20 glm::vec3 min;
21 /*0x0C*/
22 glm::vec3 max;
23 /*0x18*/
24 float radius;
25};
26
29{
32
33 bool isChar;
34
35 void Reset()
36 {
37 closeRHand = false;
38 closeLHand = false;
39 isChar = false;
40 }
41};
42
45{
46 char id[4];
51 // 1: tilt x, 2: tilt y, 4:, 8: add BlendMaps fields in header, 16: ; 0x200000 : 24500 upgraded model format: chunked .anim files, change in the exporter reordering sequence+bone blocks before name
52
53 uint32 nGlobalSequences; // AnimationRelated
54 uint32 ofsGlobalSequences; // A list of timestamps.
55 uint32 nAnimations; // AnimationRelated
56 uint32 ofsAnimations; // Information about the animations in the model.
57 uint32 nAnimationLookup; // AnimationRelated
58 uint32 ofsAnimationLookup; // Mapping of global IDs to the entries in the Animation sequences block.
59 //uint32 nD;
60 //uint32 ofsD;
61 uint32 nBones; // BonesAndLookups
62 uint32 ofsBones; // Information about the bones in this model.
63 uint32 nKeyBoneLookup; // BonesAndLookups
64 uint32 ofsKeyBoneLookup; // Lookup table for key skeletal bones.
65
66 uint32 nVertices; // GeometryAndRendering
67 uint32 ofsVertices; // Vertices of the model.
68 uint32 nViews; // GeometryAndRendering
69 //uint32 ofsViews; // Views (LOD) are now in .skins.
70
71 uint32 nColors; // ColorsAndTransparency
72 uint32 ofsColors; // Color definitions.
73
74 uint32 nTextures; // TextureAndTheifAnimation
75 uint32 ofsTextures; // Textures of this model.
76
77 uint32 nTransparency; // H, ColorsAndTransparency
78 uint32 ofsTransparency; // Transparency of textures.
79 //uint32 nI; // always unused ?
80 //uint32 ofsI;
81 uint32 nTexAnims; // J, TextureAndTheifAnimation
83 uint32 nTexReplace; // TextureAndTheifAnimation
84 uint32 ofsTexReplace; // Replaceable Textures.
85
86 uint32 nTexFlags; // Render Flags
87 uint32 ofsTexFlags; // Blending modes / render flags.
88 uint32 nBoneLookup; // BonesAndLookups
89 uint32 ofsBoneLookup; // A bone lookup table.
90
91 uint32 nTexLookup; // TextureAndTheifAnimation
92 uint32 ofsTexLookup; // The same for textures.
93
94 uint32 nTexUnitLookup; // L, TextureAndTheifAnimation, seems gone after Cataclysm
95 uint32 ofsTexUnitLookup; // And texture units. Somewhere they have to be too.
96 uint32 nTransparencyLookup; // M, ColorsAndTransparency
97 uint32 ofsTransparencyLookup; // Everything needs its lookup. Here are the transparencies.
98 uint32 nTexAnimLookup; // TextureAndTheifAnimation
99 uint32 ofsTexAnimLookup; // Wait. Do we have animated Textures? Wasn't ofsTexAnims deleted? oO
100
103
104 uint32 nBoundingTriangles; // Miscellaneous
106 uint32 nBoundingVertices; // Miscellaneous
108 uint32 nBoundingNormals; // Miscellaneous
110
111 uint32 nAttachments; // O, Miscellaneous
112 uint32 ofsAttachments; // Attachments are for weapons etc.
113 uint32 nAttachLookup; // P, Miscellaneous
114 uint32 ofsAttachLookup; // Of course with a lookup.
116 uint32 ofsEvents; // Used for playing sounds when dying and a lot else.
118 uint32 ofsLights; // Lights are mainly used in loginscreens but in wands and some doodads too.
119 uint32 nCameras; // S, Miscellaneous
120 uint32 ofsCameras; // The cameras are present in most models for having a model in the Character-Tab.
121 uint32 nCameraLookup; // Miscellaneous
122 uint32 ofsCameraLookup; // And lookup-time again, unit16
123 uint32 nRibbonEmitters; // U, Effects
124 uint32 ofsRibbonEmitters; // Things swirling around. See the CoT-entrance for light-trails.
127 // Spells and weapons, doodads and loginscreens use them. Blood dripping of a blade? Particles.
129 // Only used in models where GlobalModelFlags & 8 is true. Otherwise this field does not exist!
130 uint32 ofsTextureCombinerCombos; // An array of shorts, related to renderflags.
131};
132
133enum
134{
137 ANIMATION_LOOPED = 0x20 // flags
139
142{
143 int16 animID; // AnimationDataDB.ID
146
148
151 // This is used to determine how often the animation is played. For all animations of the same type, this adds up to 0x7FFF (32767).
155 uint32 playSpeed; // note: this can't be play speed because it's 0 for some models
156
158
161};
162
165{
166 int16 type; // interpolation type (0=none, 1=linear, 2=hermite)
167 int16 seq; // global sequence id or -1
172};
173
181
187
188enum
189{
193
196{
197 int32 keyboneid; // Back-reference to the key bone lookup table. -1 if this is no key bone.
198 int32 flags; // Only known flags: 8 - billboarded and 512 - transformed
199 int16 parent; // parent bone index
200 int16 geoid; // A geoset for this bone.
201 int32 unknown; // new int added to the bone definitions. Added in WoW 2.0
204 AnimationBlock scaling; // ( glm::vec3)
205 glm::vec3 pivot;
206};
207
209{
210 AnimationBlock trans; // ( glm::vec3)
211 AnimationBlock rot; // (QuatS)
212 AnimationBlock scale; // ( glm::vec3)
213};
214
217{
218 glm::vec3 pos;
221 glm::vec3 normal;
222 glm::vec2 texcoords;
223 int unk1, unk2; // always 0,0 so this is probably unused
224};
225
228{
229 char id[4]; // Signature
231 uint32 ofsIndex; // int16, Vertices in this model (index into vertices[])
233 uint32 ofsTris; // int16[3], indices
235 uint32 ofsProps; // int32, additional vtx properties
237 uint32 ofsSub; // ModelGeoset, materials/renderops/submeshes
239 uint32 ofsTex; // ModelTexUnit, material properties/textures
240 int32 lod; // LOD bias?
241};
242
245{
246 uint32 id; // mesh part id?
247 uint16 vstart; // first vertex, Starting vertex number.
248 uint16 vcount; // num vertices, Number of vertices.
249 uint16 istart; // first index, Starting triangle index (that's 3* the number of triangles drawn so far).
250 uint16 icount; // num indices, Number of triangle indices.
251 uint16 nSkinnedBones; // number of bone indices, Number of elements in the bone lookup table.
252 uint16 StartBones; // ? always 1 to 4, Starting index in the bone lookup table.
253 uint16 rootBone; // root bone?
255 glm::vec3 BoundingBox[2];
256 float radius;
257};
258
261{
262public:
264 id(-1), vstart(0), vcount(0),
265 istart(0), icount(0), nSkinnedBones(0),
266 StartBones(0), rootBone(0), nBones(0), radius(0), display(false)
267 {
268 BoundingBox[0] = glm::vec3(0, 0, 0);
269 BoundingBox[1] = glm::vec3(0, 0, 0);
270 }
271
273 id(geo.id & 0x7FFF), vstart(geo.vstart), vcount(geo.vcount),
276 radius(geo.radius), display(false)
277 {
278 BoundingBox[0] = geo.BoundingBox[0];
279 BoundingBox[1] = geo.BoundingBox[1];
280 }
281
283 id(geo.id), vstart(geo.vstart), vcount(geo.vcount),
286 radius(geo.radius), display(geo.display)
287 {
288 BoundingBox[0] = geo.BoundingBox[0];
289 BoundingBox[1] = geo.BoundingBox[1];
290 }
291
292 // Copy assignment operator
294 {
295 if (this != &geo) {
296 id = geo.id;
297 vstart = geo.vstart;
298 vcount = geo.vcount;
299 istart = geo.istart;
300 icount = geo.icount;
303 rootBone = geo.rootBone;
304 nBones = geo.nBones;
305 radius = geo.radius;
306 display = geo.display;
307 BoundingBox[0] = geo.BoundingBox[0];
308 BoundingBox[1] = geo.BoundingBox[1];
309 }
310 return *this;
311 }
312
313 uint32 id; // mesh part id?
314 uint16 vstart; // first vertex, Starting vertex number.
315 uint16 vcount; // num vertices, Number of vertices.
316 uint32 istart; // first index, Starting triangle index (that's 3* the number of triangles drawn so far).
317 uint16 icount; // num indices, Number of triangle indices.
318 uint16 nSkinnedBones; // number of bone indices, Number of elements in the bone lookup table.
319 uint16 StartBones; // ? always 1 to 4, Starting index in the bone lookup table.
320 uint16 rootBone; // root bone?
322 glm::vec3 BoundingBox[2];
323 float radius;
325};
326
327enum
328{
332
335{
336 // probably the texture units size always >=number of materials it seems
337 uint8_t flags; // Usually 16 for static textures, and 0 for animated textures.
339 uint16 shading; // If set to 0x8000: shaders. Used in skyboxes to ditch the need for depth buffering. See below.
340 uint16 op; // Material this texture is part of (index into mat)
341 uint16 op2; // Usually same as above. Not sure what it's for
342 int16 colorIndex; // A Color out of the Colors-Block or -1 if none.
343 uint16 flagsIndex; // RenderFlags (index into render flags, TexFlags)
344 uint16 texunit; // Index into the texture unit lookup table.
345 uint16 op_count; // Used for shaders (below), but also the number of textures to load,
346 // starting at the texture lookup in the next field.
347 uint16 textureid; // Index into Texture lookup table
348 uint16 texunit2; // copy of texture unit value?
349 uint16 transid; // Index into transparency lookup table.
350 uint16 texanimid; // Index into uvanimation lookup table.
351};
352
353/*
354Shader thingey
355Its actually two uint8s defining the shader used. Everything below this is in binary. X represents a variable digit.
356Depending on "Mode", its either "Diffuse_%s_%s" and "Combiners_%s_%s" (Mode=0) or "Diffuse_%s" and "Combiners_%s" (Mode>0).
357
358
359Diffuse
360Mode Shading String
3610 0XXX 0XXX Diffuse_T1_T2
3620 0XXX 1XXX Diffuse_T1_Env
3630 1XXX 0XXX Diffuse_Env_T2
3640 1XXX 1XXX Diffuse_Env_Env
365
3661 0XXX XXXX Diffuse_T1
3671 1XXX XXXX Diffuse_Env
368
369Combiners
370Mode Shading String
3710 X000 XXXX Combiners_Opaque_%s
3720 X001 XXXX Combiners_Mod_%s
3730 X011 XXXX Combiners_Add_%s
3740 X100 XXXX Combiners_Mod2x_%s
375
3760 XXXX X000 Combiners_%s_Opaque
3770 XXXX X001 Combiners_%s_Mod
3780 XXXX X011 Combiners_%s_Add
3790 XXXX X100 Combiners_%s_Mod2x
3800 XXXX X110 Combiners_%s_Mod2xNA
3810 XXXX X111 Combiners_%s_AddNA
382
3831 X000 XXXX Combiners_Opaque
3841 X001 XXXX Combiners_Mod
3851 X010 XXXX Combiners_Decal
3861 X011 XXXX Combiners_Add
3871 X100 XXXX Combiners_Mod2x
3881 X101 XXXX Combiners_Fade
389
390*/
391
392// block X - render flags
393/* flags */
394enum
395{
402
404{
406 //unsigned char f1;
407 //unsigned char f2;
408 uint16 blend; // see enums.h, enum BlendModes
409};
410
411// block G - color defs
412// For some swirling portals and volumetric lights, these define vertex colors.
413// Referenced from the Texture Unit blocks in the LOD part. Contains a separate timeline for transparency values.
414// If no animation is used, the given value is constant.
416{
417 AnimationBlock color; // ( glm::vec3) Three floats. One for each color.
418 AnimationBlock opacity; // (UInt16) 0 - transparent, 0x7FFF - opaque.
419};
420
421// block H - transparency defs
423{
425};
426
434
436{
437 int16 type; // 0: Directional, 1: Point light
438 int16 bone; // If its attached to a bone, this is the bone. Else here is a nice -1.
439 glm::vec3 pos; // Position, Where is this light?
440 AnimationBlock ambientColor; // ( glm::vec3) The ambient color. Three floats for RGB.
441 AnimationBlock ambientIntensity; // (Float) A float for the intensity.
442 AnimationBlock diffuseColor; // ( glm::vec3) The diffuse color. Three floats for RGB.
443 AnimationBlock diffuseIntensity; // (Float) A float for the intensity again.
444 AnimationBlock attenuationStart; // (Float) This defines, where the light starts to be.
445 AnimationBlock attenuationEnd; // (Float) And where it stops.
446 AnimationBlock useAttenuation; // (Uint32) Its an integer and usually 1.
447};
448
450{
451 int32 id; // 0 is potrait camera, 1 characterinfo camera; -1 if none; referenced in CamLookup_Table
452 float fov; // No radians, no degrees. Multiply by 35 to get degrees.
453 float farclip; // Where it stops to be drawn.
454 float nearclip; // Far and near. Both of them.
456 // ( glm::vec3) How the cameras position moves. Should be 3*3 floats. (? WoW parses 36 bytes = 3*3*sizeof(float))
457 glm::vec3 pos; // float, Where the camera is located.
458 AnimationBlock transTarget; // ( glm::vec3) How the target moves. Should be 3*3 floats. (?)
459 glm::vec3 target; // float, Where the camera points to.
460 AnimationBlock rot; // (Quat) The camera can have some roll-effect. Its 0 to 2*Pi.
461};
462
464{
465 int32 id; // 0 is potrait camera, 1 characterinfo camera; -1 if none; referenced in CamLookup_Table
466 float farclip; // Where it stops to be drawn.
467 float nearclip; // Far and near. Both of them.
469 // ( glm::vec3) How the cameras position moves. Should be 3*3 floats. (? WoW parses 36 bytes = 3*3*sizeof(float))
470 glm::vec3 pos; // float, Where the camera is located.
471 AnimationBlock transTarget; // ( glm::vec3) How the target moves. Should be 3*3 floats. (?)
472 glm::vec3 target; // float, Where the camera points to.
473 AnimationBlock rot; // (Quat) The camera can have some roll-effect. Its 0 to 2*Pi. 3 Floats!
474 AnimationBlock AnimBlock4; // (Float) One Float. cataclysm
475};
476
478{
479 FakeAnimationBlock colors; // ( glm::vec3) This one points to 3 floats defining red, green and blue.
481 // (UInt16) Looks like opacity (short), Most likely they all have 3 timestamps for {start, middle, end}.
482 FakeAnimationBlock sizes; // (glm::vec2) It carries two floats per key. (x and y scale)
485 // (UInt16) Some kind of intensity values seen: 0,16,17,32(if set to different it will have high intensity)
487 float unk[3];
488 glm::vec3 scales;
489 float slowdown;
490 float unknown1[2];
491 float rotation; //Sprite Rotation
492 float unknown2[2];
493 glm::vec3 Rot1; //Model Rotation 1
494 glm::vec3 Rot2; //Model Rotation 2
495 glm::vec3 Trans; //Model Translation
496 float f2[4];
499};
500
501// Most of these model particle flags are currently ignored by WMV:
502enum
503{
504 MODELPARTICLE_FLAGS_WORLDSPACE = 0x8, // Particles travel "up" in world space, rather than model
505 MODELPARTICLE_FLAGS_DONOTTRAIL = 0x10, // Do not trail
506 MODELPARTICLE_FLAGS_MODELSPACE = 0x80, // Particles in model space
507 MODELPARTICLE_FLAGS_PINNED = 0x400, // Pinned Particles, their quad enlarges from their creation
508// position to where they expand
509 MODELPARTICLE_FLAGS_DONOTBILLBOARD = 0x1000, // Wiki says: XYQuad Particles. They align to XY axis
510// facing Z axis direction
511 MODELPARTICLE_FLAGS_RANDOMTEXTURE = 0x10000, // Choose Random Texture
512 MODELPARTICLE_FLAGS_OUTWARD = 0x20000, // "Outward" particles, most emitters have this and
513// their particles move away from the origin, when they
514// don't the particles start at origin+(speed*life) and
515// move towards the origin
516 MODELPARTICLE_FLAGS_RANDOMSTART = 0x200000, // Random Flip Book Start
517 MODELPARTICLE_FLAGS_BONEGENERATOR = 0x1000000, // Bone generator = bone, not joint
518 MODELPARTICLE_FLAGS_DONOTTHROTTLE = 0x4000000, // Do not throttle emission rate based on distance
519 MODELPARTICLE_FLAGS_MULTITEXTURE = 0x10000000, // Particle uses multi-texturing. This affects emitter values
524
525template <typename Base, size_t integer_bits, size_t decimal_bits>
527{
528 Base decimal : decimal_bits;
529 Base integer : integer_bits;
530 Base sign : 1;
531 float to_float() const { return (sign ? -1.0f : 1.0f) * (integer + decimal / static_cast<float>(1 << decimal_bits)); }
532};
533
536
542
545{
546 int32 id; // so far it's always -1
547 int32 flags; // MODELPARTICLE_FLAGS_*
548 glm::vec3 pos; // The position. Relative to the following bone.
549 int16 bone; // The bone it's attached to.
550 int16 texture; // And the texture that is used. In multitextured particles this is actually composed of
551 // three 5-bit texture ints, plus 1 bit left over.
557 uint8 EmitterType; // EmitterType 1 - Plane (rectangle), 2 - Sphere, 3 - Spline? (can't be bothered to find one)
559 // If used then it's usually 11, 12 or 13. This one is used so you can assign a color to specific particles. They loop over all
560 // particles and compare +0x2A to 11, 12 and 13. If that matches, the colors from the dbc get applied.
561 fp_2_5 multiTextureParamX[2]; // used for multitextured particles, but not sure how, yet
562 int16 TextureTileRotation; // TODO, Rotation for the texture tile. (Values: -1,0,1)
563 uint16 rows; // How many different frames are on that texture? People should learn what rows and cols are.
564 uint16 cols; // (2, 2) means slice texture to 2*2 pieces
565 AnimationBlock EmissionSpeed; // (Float) All of the following blocks should be floats.
566 AnimationBlock SpeedVariation; // (Float) Variation in the flying-speed. (range: 0 to 1)
567 AnimationBlock VerticalRange; // (Float) Drifting away vertically. (range: 0 to pi)
568 AnimationBlock HorizontalRange; // (Float) They can do it horizontally too! (range: 0 to 2*pi)
572 AnimationBlock EmissionRate; // (Float) Spread your particles, emitter.
574 AnimationBlock EmissionAreaLength; // (Float) Well, you can do that in this area.
577 // When greater than 0, the initial velocity of the particle is (particle.position - C3Vector(0, 0, zSource)).Normalize()
582};
583
585{
588 glm::vec3 pos;
593 AnimationBlock color; // ( glm::vec3)
594 AnimationBlock opacity; // (UInt16) And an alpha value in a short, where: 0 - transparent, 0x7FFF - opaque.
595 AnimationBlock above; // (Float) The height above.
596 AnimationBlock below; // (Float) The height below. Do not set these to the same!
597 float res; // This defines how smooth the ribbon is. A low value may produce a lot of edges.
598 float length; // The length aka Lifespan.
599 float Emissionangle; // use arcsin(val) to get the angle in degree
602 AnimationBlock unk2; // (boolean)
603 int32 unknown; // This looks much like just some Padding to the fill up the 0x10 Bytes, always 0
604};
605
606/*
607These events are used for timing sounds for example. You can find the $DTH (death) event on nearly every model. It will play the death sound for the unit.
608The events you can use depend on the way, the model is used. Dynamic objects can shake the camera, doodads shouldn't. Units can do a lot more than other objects.
609Somehow there are some entries, that don't use the $... names but identifiers like "DEST" (destination), "POIN" (point) or "WHEE" (wheel). How they are used? Idk.
610*/
612{
613 char id[4]; // This is a (actually 3 character) name for the event with a $ in front.
614 int32 dbid; // This data is passed when the event is fired.
615 int32 bone; // Somewhere it has to be attached.
616 glm::vec3 pos; // Relative to that bone of course.
617 int16 type; // This is some fake-AnimationBlock.
618 int16 seq; // Built up like a real one but without timestamps(?). What the fuck?
619 uint32 nTimes; // See the documentation on AnimationBlocks at this topic.
620 uint32 ofsTimes; // This points to a list of timestamps for each animation given.
621};
622
623/*
624There are a lot more of them. I did not list all up to now.
625ID Data Description
626DEST exploding ballista, that one has a really fucked up block. Oo
627POIN unk something alliance gunship related (flying in icecrown)
628WHEE 601+ Used on wheels at vehicles.
629$tsp p is {0 to 3} (position); t is {W, S, B, F (feet) or R} (type); s is {R or L} (right or left); this is used when running through snow for example.
630$AHx UnitCombat_C, x is {0 to 3}
631$BRT Plays some sound.
632$BTH Used for bubbles or breath. ("In front of head")
633$BWP UnitCombat_C
634$BWR Something with bow and rifle. Used in AttackRifle, AttackBow etc. "shoot now"?
635$CAH UnitCombat_C
636$Cxx UnitCombat_C, x is {P or S}
637$CSD SoundEntries.dbc Emote sounds?
638$CVS SoundEntriesAdvanced.dbc Sound
639$DSE
640$DSL SoundEntries.dbc Sound with something special. Use another one if you always want to have it playing..
641$DSO SoundEntries.dbc Sound
642$DTH UnitCombat_C, death, this plays death sounds and more.
643$EMV MapLoad.cpp
644$ESD Plays some emote sound.
645$EWT MapLoad.cpp
646$FDx x is {1 to 5}. Calls some function in the Object VMT. Also plays some sound.
647$FDx x is {6 to 9}. Calls some function in the Object VMT.
648$FDX Should do nothing. But is existant.
649$FSD Plays some sound.
650$GCx Play gameobject custom sound referenced in GameObjectDisplayInfo.dbc. x can be from {0 to 3}: {Custom0, Custom1, Custom2, Custom3}
651$GOx Play gameobject sound referenced in GameObjectDisplayInfo.dbc. x can be from {0 to 5}: {Stand, Open, Loop, Close, Destroy, Opened}
652$HIT Get hit?
653$KVS MapLoad.cpp
654$SCD Plays some sound.
655$SHK SpellEffectCameraShakes.dbc Add a camera shake
656$SHx x is {L or R}, fired on Sheath and SheathHip. "Left/right shoulder" was in the old list.
657$SMD Plays some sound.
658$SMG Plays some sound.
659$SND SoundEntries.dbc Sound
660$TRD Does something with a spell, a sound and a spellvisual.
661$VGx UnitVehicle_C, x is {0 to 8}
662$VTx UnitVehicle_C, x is {0 to 8}
663$WxG x is {W or N}. Calls some function in the Object VMT.
664------- ---------------------------------- - Old documentation (?) ----------------------------------------------
665$CSx x is {L or R} ("Left/right hand") (?)
666$CFM
667$CHD ("Head") (?)
668$CCH ("Bust") (?)
669$TRD ("Crotch") (?)
670$CCH ("Bust") (?)
671$BWR ("Right hand") (?)
672$CAH
673$CST
674*/
675
676/*
677 * This block specifies a bunch of locations on the body - hands, shoulders, head, back,
678 * knees etc. It is used to put items on a character. This seems very likely as this block
679 * also contains positions for sheathed weapons, a shield, etc.
680 */
683{
684 uint32 id; // Just an id. Is referenced in the enum POSITION_SLOTS.
685 uint32 bone; // Somewhere it has to be attached.
686 glm::vec3 pos; // Relative to that bone of course.
687 AnimationBlock unk; // (Int32) Its an integer in the data. It has been 1 on all models I saw. Whatever.
688};
689
690#pragma pack(pop)
Extended geoset with 32-bit index start to support HD models with > 65535 indices.
ModelGeosetHD(const ModelGeosetHD &geo)
glm::vec3 BoundingBox[2]
uint16 nSkinnedBones
ModelGeosetHD(ModelGeoset &geo)
ModelGeosetHD & operator=(const ModelGeosetHD &geo)
@ RENDERFLAGS_UNFOGGED
@ RENDERFLAGS_ZBUFFERED
@ RENDERFLAGS_BILLBOARD
@ RENDERFLAGS_UNLIT
@ RENDERFLAGS_TWOSIDED
@ MODELBONE_BILLBOARD
@ MODELBONE_TRANSFORM
@ TEXTUREUNIT_IGNORE_TEXTURE_WEIGHTS
@ TEXTUREUNIT_STATIC
@ MODELPARTICLE_FLAGS_BONEGENERATOR
@ MODELPARTICLE_FLAGS_MULTITEXTURE
@ MODELPARTICLE_FLAGS_DONOTTRAIL
@ MODELPARTICLE_FLAGS_DONOTTHROTTLE
@ MODELPARTICLE_EMITTER_SPLINE
@ MODELPARTICLE_FLAGS_MODELSPACE
@ MODELPARTICLE_FLAGS_OUTWARD
@ MODELPARTICLE_FLAGS_PINNED
@ MODELPARTICLE_FLAGS_RANDOMSTART
@ MODELPARTICLE_FLAGS_WORLDSPACE
@ MODELPARTICLE_FLAGS_DONOTBILLBOARD
@ MODELPARTICLE_FLAGS_RANDOMTEXTURE
@ MODELPARTICLE_EMITTER_PLANE
@ MODELPARTICLE_EMITTER_SPHERE
@ ANIMATION_LOOPED
@ ANIMATION_HANDSCLOSED
@ ANIMATION_MOUNT
Sub-block header for animated values in M2 models.
Tracks character-specific model state (hand closure, character flag).
On-disk particle emitter definition in an M2 file.
glm::vec3 pos
vector_2fp_6_9 multiTextureParam0[2]
ModelParticleParams p
AnimationBlock SpeedVariation
vector_2fp_6_9 multiTextureParam1[2]
AnimationBlock HorizontalRange
AnimationBlock VerticalRange
AnimationBlock EnabledIn
uint16 ParticleColorIndex
AnimationBlock zSource
AnimationBlock Gravity
int16 TextureTileRotation
AnimationBlock EmissionRate
int32 ofsParticleFileName
AnimationBlock Lifespan
int32 ofsModelFileName
int32 nParticleFileName
AnimationBlock EmissionAreaWidth
AnimationBlock EmissionSpeed
fp_2_5 multiTextureParamX[2]
AnimationBlock EmissionAreaLength
An animation sequence entry in the M2 model (block B).
On-disk attachment point definition in an M2 file.
AnimationBlock unk
On-disk bone definition (block E) in an M2 file.
AnimationBlock translation
AnimationBlock rotation
glm::vec3 pivot
AnimationBlock scaling
AnimationBlock rot
AnimationBlock transPos
AnimationBlock AnimBlock4
AnimationBlock transTarget
glm::vec3 target
AnimationBlock rot
AnimationBlock transPos
AnimationBlock transTarget
AnimationBlock color
AnimationBlock opacity
glm::vec3 pos
A submesh/geoset within a model LOD view (one material + draw call).
uint16 StartBones
uint16 rootBone
glm::vec3 BoundingBox[2]
uint16 nSkinnedBones
M2 model file header — offsets and counts for all data blocks.
uint32 ofsVertices
uint32 ofsTexReplace
uint32 nTextureCombinerCombos
uint32 ofsEvents
uint32 nTextures
uint32 nAttachments
uint32 ofsAnimationLookup
uint32 nBoundingNormals
uint32 nameLength
uint32 nViews
uint32 ofsTexLookup
uint32 nTexFlags
uint32 ofsAnimations
uint32 ofsTextures
uint32 nRibbonEmitters
uint32 nBoundingVertices
uint32 nameOfs
uint32 nBones
uint32 ofsTransparencyLookup
uint32 nCameras
uint32 nBoundingTriangles
uint32 ofsAttachments
uint32 nTransparencyLookup
uint32 ofsCameras
uint32 nCameraLookup
uint32 ofsTexAnims
uint32 ofsBoundingNormals
uint32 nTexLookup
uint32 ofsBones
uint32 ofsLights
uint32 ofsGlobalSequences
uint32 nColors
Sphere collisionSphere
uint32 ofsTransparency
uint32 ofsTexAnimLookup
uint32 nTexAnimLookup
uint32 nTexUnitLookup
uint32 ofsColors
uint32 ofsParticleEmitters
uint32 ofsCameraLookup
uint32 nAttachLookup
uint32 ofsAttachLookup
uint32 nAnimations
uint32 nVertices
uint32 nAnimationLookup
uint32 nTransparency
Sphere boundSphere
uint32 ofsTextureCombinerCombos
uint32 ofsTexFlags
uint32 nGlobalSequences
uint32 nKeyBoneLookup
uint32 nTexAnims
uint32 ofsBoneLookup
uint32 nTexReplace
uint32 nParticleEmitters
uint8 version[4]
uint32 GlobalModelFlags
uint32 ofsRibbonEmitters
uint32 nBoneLookup
uint32 ofsKeyBoneLookup
uint32 ofsBoundingVertices
uint32 ofsBoundingTriangles
uint32 ofsTexUnitLookup
AnimationBlock useAttenuation
glm::vec3 pos
AnimationBlock ambientIntensity
AnimationBlock ambientColor
AnimationBlock diffuseIntensity
AnimationBlock diffuseColor
AnimationBlock attenuationStart
AnimationBlock attenuationEnd
FakeAnimationBlock opacity
FakeAnimationBlock Intensity
FakeAnimationBlock unk2
FakeAnimationBlock sizes
FakeAnimationBlock colors
AnimationBlock unk2
AnimationBlock above
AnimationBlock opacity
AnimationBlock below
AnimationBlock unk1
AnimationBlock color
AnimationBlock rot
AnimationBlock trans
AnimationBlock scale
Lod part, A texture unit (sub of material)
uint16 flagsIndex
int8_t priorityPlane
AnimationBlock trans
A vertex as stored in the M2 file (position, bone weights, normal, texcoord).
uint8 bones[4]
glm::vec3 normal
glm::vec3 pos
uint8 weights[4]
glm::vec2 texcoords
Lod part,.
uint32 ofsSub
uint32 ofsProps
uint32 ofsTris
uint32 nTex
uint32 nSub
uint32 nIndex
uint32 nProps
uint32 ofsTex
uint32 ofsIndex
uint32 nTris
Axis-aligned bounding sphere.
glm::vec3 max
Maximum corner of the bounding box.
glm::vec3 min
Minimum corner of the bounding box.
float radius
Bounding sphere radius.
A simple vertex with texture coordinates and position.
float y
float tu
float x
float tv
Texture coordinates.
float z
Position.
float to_float() const
uint8_t uint8
Definition types.h:30
int16_t int16
Definition types.h:33
int32_t int32
Definition types.h:35
uint16_t uint16
Definition types.h:32
uint32_t uint32
Definition types.h:34