SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
MDL.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstddef>
5#include <cstdint>
6#include <optional>
7#include <string>
8#include <variant>
9#include <vector>
10
11#include "Generic.h"
12
13namespace mdlpp::MDL {
14
15// Header2 structs
17 //int32_t nameIndex;
18 std::string name;
19
20 sourcepp::math::Mat3x4f pretransform;
21 sourcepp::math::Mat3x4f posttransform;
22};
23
24struct LinearBone {
25 int32_t boneCount;
26
27 std::vector<int32_t> flags;
28 std::vector<int32_t> parent;
29 std::vector<sourcepp::math::Vec3f> position;
30 std::vector<sourcepp::math::Quat> quaternion;
31 std::vector<sourcepp::math::Vec3f> rotation;
32 std::vector<sourcepp::math::Mat3x4f> poseToBone;
33 std::vector<sourcepp::math::Vec3f> positionScale;
34 std::vector<sourcepp::math::Vec3f> rotationScale;
35 std::vector<sourcepp::math::Quat> quaternionAlignment;
36};
37
41 float min;
42 float max;
43};
44
46 int32_t boneIndex;
47
48 //int32_t controlCount;
49 //int32_t controlIndex;
50 std::vector<BoneFlexDriverControl> controls;
51
52 //int32_t unused[3];
53};
54
55// Bone structs
56struct Bone {
85
86 //int32_t nameIndex;
87 std::string name;
88
89 int32_t parent;
90 std::array<int32_t, 6> boneController;
91 sourcepp::math::Vec3f position;
93 sourcepp::math::Vec3f rotationEuler;
94 sourcepp::math::Vec3f positionScale;
95 sourcepp::math::Vec3f rotationScale;
96 sourcepp::math::Mat3x4f poseToBose;
99 int32_t procType;
100 int32_t procIndex;
101 int32_t physicsBone;
102
103 //int32_t surfacePropNameIndex;
104 std::string surfacePropName;
105
106 int32_t contents;
107
108 //int32_t _unused0[8];
109};
111
113 int32_t bone;
114 int32_t type;
115 float start;
116 float end;
117 int32_t rest;
118 int32_t inputField;
119
120 //int32_t _unused0[8];
121};
122
123// Hitbox structs
124struct HitboxSet {
125 //int32_t nameIndex;
126 std::string name;
127
128 //int32_t hitboxCount;
129 //int32_t hitboxIndex;
130 std::vector<BBox> hitboxes;
131};
132
133// Animation structs
135 enum Flags : uint8_t {
137 FLAG_RAW_POS = 1 << 0,
138 FLAG_RAW_ROT = 1 << 1,
141 FLAG_DELTA = 1 << 4,
143 };
144
145 uint8_t bone;
147
148 // static data when RAW flags are set
149 std::variant<std::monostate, sourcepp::math::QuatCompressed48, sourcepp::math::QuatCompressed64> staticRotation;
150 std::optional<sourcepp::math::Vec3Compressed48> staticPosition;
151
152 // keyframe data when ANIM flags are set
153 std::optional<AnimValuePtr> animRotationPtr;
154 std::optional<AnimValuePtr> animPositionPtr;
155 std::vector<AnimValue> animRotationData; // Keyframe arrays
156 std::vector<AnimValue> animPositionData; // Keyframe arrays
157};
159
160struct IKError {
161 sourcepp::math::Vec3f position;
163};
164
170
171struct IKRule {
172 int32_t index;
173 int32_t type;
174 int32_t chain;
175 int32_t bone;
176 int32_t slot;
177 float height;
178 float radius;
179 float floor;
180 sourcepp::math::Vec3f pos;
182
183 //int32_t compressedIKErrorIndex;
184 std::optional<CompressedIKError> compressedIKError;
185
186 //int32_t unused2;
187
188 int32_t iStart;
189 //int32_t ikErrorIndex;
190 std::vector<IKError> ikErrors;
191
192 float start;
193 float peak;
194 float tail;
195 float end;
196 //float unused3;
197 float contact;
198 float drop;
199 float top;
200
201 //int32_t unused6;
202 //int32_t unused7;
203 //int32_t unused8;
204
205 //int32_t attachmentIndex;
206 std::string attachment; // just the name
207
208 //int32_t unused[7];
209};
210
212 int32_t bone{};
213 int32_t newParent{};
214 float start{};
215 float peak{};
216 float tail{};
217 float end{};
218 int32_t startFrame{};
219
220 //int32_t localAnimIndex;
221 std::optional<CompressedIKError> compressedIKError;
222
223 //int32_t unused[4];
224};
225
227 int32_t animBlock;
228 int32_t animIndex;
229};
230
231struct AnimDesc {
232 enum Flags : int32_t {
234 FLAG_RAW_POS = 1 << 0,
235 FLAG_RAW_ROT = 1 << 1,
238 FLAG_DELTA = 1 << 4,
240 };
241
242 //int32_t basePointer;
243
244 //int32_t nameIndex;
245 std::string name;
246 float fps;
247
249
250 int32_t frameCount;
251
252 //int32_t movementCount;
253 //int32_t movementIndex;
254 std::vector<Movement> movements;
255
256 //int32_t _unused0[6];
257
258 int32_t animBlock;
259 int32_t animIndex;
260
261 //int32_t ikRuleCount;
262 //int32_t ikRuleIndex;
263 std::vector<IKRule> ikRules;
264
266
267 //int32_t localHierarchyCount;
268 //int32_t localHierarchyIndex;
269 std::vector<LocalHierarchy> localHierarchies;
270
271 //int32_t sectionIndex;
273 std::vector<AnimSection> sections;
274
279
280 // animation data
281 std::vector<AnimBoneData> boneAnimations;
282};
284
285// Sequence structs
286struct Event {
287 float cycle;
288 int32_t event;
289 int32_t type;
290
291 //char options[64];
292 std::string options;
293
294 //int32_t eventNameIndex;
295 std::string eventName;
296};
297
298struct AutoLayer {
299 int16_t sequence;
300 int16_t pose;
301 int32_t flags;
302 float start;
303 float peak;
304 float tail;
305 float end;
306};
307
309 enum Flags : int32_t {
311 FLAG_LOOPING = 1 << 0,
312 };
313
314 //int32_t basePointer;
315
316 //int32_t labelIndex;
317 std::string label;
318
319 //int32_t activityLabelIndex;
320 std::string activityName;
321
323
324 int32_t activity;
326
327 //int32_t eventCount;
328 //int32_t eventIndex;
329 std::vector<Event> events;
330
331 sourcepp::math::Vec3f boundingBoxMin;
332 sourcepp::math::Vec3f boundingBoxMax;
333
334 int32_t blendCount;
335
336 //int32_t animIndexIndex;
337 std::vector<int16_t> animIndices; // groupSize[0] * groupSize[1] (for animation blending)
338
340
341 int32_t groupSize[2];
342 int32_t paramIndex[2];
343 float paramStart[2];
344 float paramEnd[2];
345 int32_t paramParent;
346
349
352
353 int32_t nodeFlags;
354
357
359
361 int32_t pose;
362
363 int32_t ikRuleCount;
364
365 //int32_t autoLayerCount;
366 //int32_t autoLayerIndex;
367 std::vector<AutoLayer> autoLayers;
368
369 //int32_t weightListIndex;
370 std::vector<float> boneWeights;
371
372 //int32_t poseKeyIndex;
373 std::vector<float> poseKeys;
374
375 //int32_t ikLockCount;
376 //int32_t ikLockIndex;
377 std::vector<IKLock> ikLocks;
378
379 //int32_t keyValueIndex;
380 //int32_t keyValueSize;
381 std::string keyValues;
382
383 int32_t cyclePoseIndex; // index into poseParameters
384
385 //int32_t activityModifierCount;
386 //int32_t activityModifierIndex;
387 std::vector<std::string> activityModifiers;
388
389 //int32_t _unused0[5];
390};
392
393// Material structs
394struct Material {
395 enum Flags : int32_t {
398 // Note: mstudiotexture_t.flags field exists in the format but is never set by the studiomdl compiler.
399 // The engine might still check this flag, so it is exposed here anyway.
400 };
401
402 //int32_t nameIndex;
403 std::string name;
404
406
407 //int32_t used; // No idea what this is
408 //int32_t _unused0[13];
409};
411
412// BodyPart structs (Model, Mesh, Flex, Eyeball, Attachment)
413struct Eyeball {
414 //int32_t sznameindex;
415 std::string name;
416
417 int32_t bone;
418 sourcepp::math::Vec3f org;
419 float zOffset;
420 float radius;
421 sourcepp::math::Vec3f up;
422 sourcepp::math::Vec3f forward;
423 int32_t texture;
424
425 //int32_t unused1;
427 //int32_t unused2;
428
429 std::array<int32_t, 3> upperFlexDesc;
430 std::array<int32_t, 3> lowerFlexDesc;
431 std::array<float, 3> upperTarget;
432 std::array<float, 3> lowerTarget;
433
436 //int32_t unused[4];
438 //char unused3[3];
439 //int32_t unused4[7];
440};
441
443 uint16_t index;
444 uint8_t speed; // 255/max_length_in_flex
445 uint8_t side; // 255/left_right
446
447 // pos delta
448 std::array<int16_t, 3> delta;
449
450 // normal delta
451 std::array<int16_t, 3> ndelta;
452};
453
455 uint16_t index;
456 uint8_t speed;
457 uint8_t side;
458 std::array<int16_t, 3> delta;
459 std::array<int16_t, 3> ndelta;
461};
462
463struct MeshFlex {
465
466 // control curve
467 float target0;
468 float target1;
469 float target2;
470 float target3;
471
472 //int32_t numverts;
473 //int32_t vertindex;
474 std::vector<VertexAnim> vertAnims;
475 std::vector<VertexAnimWrinkle> vertAnimsWrinkle;
476
477 int32_t flexPair;
478 uint8_t vertAnimType; // 0=normal, 1=wrinkle
479 //uint8_t unusedchar[3];
480 //int32_t unused[6];
481};
482
483struct Mesh {
484 int32_t material;
485
486 //int32_t modelOffset;
487
488 // These do not map to raw memory
491
492 //int32_t flexesCount;
493 //int32_t flexesOffset;
494 std::vector<MeshFlex> flexes;
495
498
499 int32_t meshID;
500
501 sourcepp::math::Vec3f center;
502
504 std::array<int32_t, MAX_LOD_COUNT> numLODVertexes;
505 //int32_t _unused[8];
506};
507
509 //int32_t nameIndex;
510 std::string name;
511
512 int32_t bone;
513 sourcepp::math::Vec3f position;
514
515 sourcepp::math::Mat3x4f localMatrix;
516 //int32_t _unused[8];
517};
518
519struct Model {
520 //char name[64];
521 std::string name;
522
523 int32_t type;
524
526
527 //int32_t meshesCount;
528 //int32_t meshesOffset;
529 std::vector<Mesh> meshes;
530
531 // These do not map to raw memory
535
536 //int32_t attachmentsCount;
537 //int32_t attachmentsOffset;
538 std::vector<Attachment> attachments;
539
540 //int32_t eyeballsCount;
541 //int32_t eyeballsOffset;
542 std::vector<Eyeball> eyeballs;
543
544 //int32_t _unused0[10];
545};
546
547struct BodyPart {
548 //int32_t nameOffset;
549 std::string name;
550
551 //int32_t modelsCount;
552 int32_t base; // multiplier for bodygroup skin index calculation?
553 //int32_t modelsOffset;
554 std::vector<Model> models;
555};
556
557// Flex structs
559 //int32_t typeIndex;
560 std::string type;
561
562 //int32_t nameIndex;
563 std::string name;
564
566 float min;
567 float max;
568};
569
593
594struct FlexOp {
595 int32_t op;
596 union {
597 int32_t index;
598 float value;
599 } d;
600};
601
602struct FlexRule {
603 int32_t flex;
604
605 //int32_t opCount;
606 //int32_t opIndex;
607 std::vector<FlexOp> ops;
608};
609
610// IK structs
611struct IKLink {
612 int32_t bone;
613 sourcepp::math::Vec3f kneeDir;
614 //sourcepp::math::Vec3f unused;
615};
616
617struct IKChain {
618 //int32_t nameIndex;
619 std::string name;
620
621 int32_t linkType;
622
623 //int32_t linkCount;
624 //int32_t linkIndex;
625 std::vector<IKLink> links;
626};
627
628// Mouth struct
629struct Mouth {
630 int32_t bone;
631 sourcepp::math::Vec3f forward;
633};
634
635// Pose parameter struct
637 //int32_t nameIndex;
638 std::string name;
639
640 int32_t flags;
641 float start;
642 float end;
643 float loop;
644};
645
646// Include model struct
648 //int32_t labelIndex;
649 std::string label;
650
651 //int32_t nameIndex;
652 std::string name;
653};
654
655// Animation block struct
656struct AnimBlock {
657 // external offsets
658 int32_t dataStart;
659 int32_t dataEnd;
660};
661
662// Flex controller UI struct
664 //int32_t nameIndex;
665 std::string name;
666
667 // SIMPLE/STEREO/NWAY
668 //int32_t szindex0;
669 //int32_t szindex1;
670 //int32_t szindex2;
671 std::string controllerName0; // non-stereo || left controller (stereo)
672 std::string controllerName1; // right controller (stereo)
673 std::string controllerName2; // value controller (NWAY only)
674
675 uint8_t remapType;
676 bool stereo;
677 //uint8_t unused[2];
678};
679
680// Main struct
681struct MDL {
682 [[nodiscard]] bool open(const std::byte* data, std::size_t size);
683
704
705 //int32_t id;
706 int32_t version;
707 int32_t checksum;
708
709 //char name[64];
710 std::string name;
711 //int32_t dataLength;
712
713 sourcepp::math::Vec3f eyePosition;
714 sourcepp::math::Vec3f illuminationPosition;
715 sourcepp::math::Vec3f hullMin;
716 sourcepp::math::Vec3f hullMax;
717 sourcepp::math::Vec3f viewBBoxMin;
718 sourcepp::math::Vec3f viewBBoxMax;
719
721
722 //int32_t boneCount;
723 //int32_t boneOffset;
724 std::vector<Bone> bones;
725
726 //int32_t boneControllerCount;
727 //int32_t boneControllerOffset;
728 std::vector<BoneController> boneControllers;
729
730 //int32_t hitboxCount;
731 //int32_t hitboxOffset;
732 std::vector<HitboxSet> hitboxSets;
733
734 //int32_t localAnimationCount;
735 //int32_t localAnimationOffset;
736 std::vector<AnimDesc> animations;
737
738 //int32_t localSequenceCount;
739 //int32_t localSequenceOffset;
740 std::vector<SequenceDesc> sequences;
741
744
745 //int32_t materialCount;
746 //int32_t materialOffset;
747 std::vector<Material> materials;
748
749 //int32_t materialDirCount;
750 //int32_t materialDirOffset;
751 std::vector<std::string> materialDirectories;
752
753 //int32_t skinReferenceCount;
754 //int32_t skinReferenceFamilyCount;
755 //int32_t skinReferenceIndex;
756 std::vector<std::vector<int16_t>> skins;
757
758 //int32_t bodyPartCount;
759 //int32_t bodyPartOffset;
760 std::vector<BodyPart> bodyParts;
761
762 //int32_t attachmentCount;
763 //int32_t attachmentOffset;
764 std::vector<Attachment> attachments;
765
766 //int32_t localNodeCount;
767 //int32_t localNodeIndex;
768 //int32_t localNodeNameIndex;
769 std::vector<std::string> localNodeNames;
770 std::vector<uint8_t> localNodeTransitions;
771
772 //int32_t flexDescCount;
773 //int32_t flexDescIndex;
774 std::vector<std::string> flexDescs;
775
776 //int32_t flexControllerCount;
777 //int32_t flexControllerIndex;
778 std::vector<FlexController> flexControllers;
779
780 //int32_t flexRulesCount;
781 //int32_t flexRulesIndex;
782 std::vector<FlexRule> flexRules;
783
784 //int32_t ikChainCount;
785 //int32_t ikChainIndex;
786 std::vector<IKChain> ikChains;
787
788 //int32_t mouthsCount;
789 //int32_t mouthsIndex;
790 std::vector<Mouth> mouths;
791
792 //int32_t localPoseParamCount;
793 //int32_t localPoseParamIndex;
794 std::vector<PoseParameter> poseParameters;
795
796 //int32_t surfacePropertyIndex;
797 std::string surfaceProperty;
798
799 //int32_t keyValueIndex;
800 //int32_t keyValueCount;
801 std::string keyValues;
802
803 //int32_t localIKAutoplayLockCount;
804 //int32_t localIKAutoplayLockIndex;
805 std::vector<IKLock> ikAutoplayLocks;
806
807 float mass;
809
810 //int32_t includeModelCount;
811 //int32_t includeModelIndex;
812 std::vector<IncludeModel> includeModels;
813
814 // int32_t virtualModel;
815
816 //int32_t animationBlocksNameIndex;
817 //int32_t animationBlocksCount;
818 //int32_t animationBlocksIndex;
820 std::vector<AnimBlock> animationBlocks;
821
822 // int32_t animationBlockModel;
823
824 //int32_t boneTableByNameIndex;
825 std::vector<uint8_t> boneTableByName;
826
827 // int32_t vertexBase;
828 // int32_t offsetBase;
829
831 uint8_t rootLOD;
833 //uint8_t _unused0;
834
835 //int32_t _unused1;
836
837 //int32_t flexControllerUICount;
838 //int32_t flexControllerUIIndex;
839 std::vector<FlexControllerUI> flexControllerUIs;
840
842 //int32_t _unused2;
843
845
846 //int32_t _unused3;
847
860 bool hasHeader2 = false;
861
862 std::vector<SrcBoneTransform> srcBoneTransforms;
863 std::optional<LinearBone> linearBone;
864 std::vector<BoneFlexDriver> boneFlexDrivers;
865};
867
868} // namespace mdlpp::MDL
#define SOURCEPP_BITFLAGS_ENUM(Enum)
Defines bitwise operators for an enum or enum class.
Definition Macros.h:29
FlexOpType
Definition MDL.h:570
@ FLEX_OP_2WAY_0
Definition MDL.h:585
@ FLEX_OP_FETCH2
Definition MDL.h:573
@ FLEX_OP_MAX
Definition MDL.h:583
@ FLEX_OP_NWAY
Definition MDL.h:587
@ FLEX_OP_DME_LOWER_EYELID
Definition MDL.h:590
@ FLEX_OP_DIV
Definition MDL.h:577
@ FLEX_OP_COMMA
Definition MDL.h:582
@ FLEX_OP_EXP
Definition MDL.h:579
@ FLEX_OP_MUL
Definition MDL.h:576
@ FLEX_OP_FETCH1
Definition MDL.h:572
@ FLEX_OP_COMBO
Definition MDL.h:588
@ FLEX_OP_MIN
Definition MDL.h:584
@ FLEX_OP_ADD
Definition MDL.h:574
@ FLEX_OP_DME_UPPER_EYELID
Definition MDL.h:591
@ FLEX_OP_CLOSE
Definition MDL.h:581
@ FLEX_OP_NEG
Definition MDL.h:578
@ FLEX_OP_DOMINATE
Definition MDL.h:589
@ FLEX_OP_OPEN
Definition MDL.h:580
@ FLEX_OP_SUB
Definition MDL.h:575
@ FLEX_OP_2WAY_1
Definition MDL.h:586
@ FLEX_OP_CONST
Definition MDL.h:571
Vec4f Quat
Definition Math.h:364
int32_t dataEnd
Definition MDL.h:659
int32_t dataStart
Definition MDL.h:658
std::optional< AnimValuePtr > animPositionPtr
Definition MDL.h:154
std::variant< std::monostate, sourcepp::math::QuatCompressed48, sourcepp::math::QuatCompressed64 > staticRotation
Definition MDL.h:149
std::optional< AnimValuePtr > animRotationPtr
Definition MDL.h:153
std::optional< sourcepp::math::Vec3Compressed48 > staticPosition
Definition MDL.h:150
std::vector< AnimValue > animPositionData
Definition MDL.h:156
std::vector< AnimValue > animRotationData
Definition MDL.h:155
int32_t sectionFrames
Definition MDL.h:272
std::vector< AnimBoneData > boneAnimations
Definition MDL.h:281
std::string name
Definition MDL.h:245
int16_t zeroFrameCount
Definition MDL.h:276
int32_t frameCount
Definition MDL.h:250
int32_t animBlockIKRuleIndex
Definition MDL.h:265
int32_t animIndex
Definition MDL.h:259
std::vector< LocalHierarchy > localHierarchies
Definition MDL.h:269
int16_t zeroFrameSpan
Definition MDL.h:275
int32_t zeroFrameIndex
Definition MDL.h:277
std::vector< Movement > movements
Definition MDL.h:254
std::vector< IKRule > ikRules
Definition MDL.h:263
std::vector< AnimSection > sections
Definition MDL.h:273
int32_t animBlock
Definition MDL.h:258
float zeroFrameStallTime
Definition MDL.h:278
sourcepp::math::Vec3f position
Definition MDL.h:513
std::string name
Definition MDL.h:510
sourcepp::math::Mat3x4f localMatrix
Definition MDL.h:515
int16_t sequence
Definition MDL.h:299
std::vector< Model > models
Definition MDL.h:554
std::string name
Definition MDL.h:549
std::vector< BoneFlexDriverControl > controls
Definition MDL.h:50
sourcepp::math::Quat rotationQuat
Definition MDL.h:92
sourcepp::math::Quat alignment
Definition MDL.h:97
sourcepp::math::Vec3f rotationEuler
Definition MDL.h:93
sourcepp::math::Vec3f positionScale
Definition MDL.h:94
sourcepp::math::Vec3f position
Definition MDL.h:91
@ FLAG_EMPTY_SLOT
Definition MDL.h:82
@ FLAG_USED_BY_BONE_MERGE
Definition MDL.h:75
@ FLAG_FIXED_ALIGNMENT
Definition MDL.h:79
@ FLAG_PHYSICS_PROCEDURAL
Definition MDL.h:60
@ FLAG_USED_BY_ANYTHING
Definition MDL.h:78
@ FLAG_USED_BY_VERTEX_LOD7
Definition MDL.h:74
@ FLAG_SCREEN_ALIGN_SPHERE
Definition MDL.h:62
@ FLAG_PHYSICALLY_SIMULATED
Definition MDL.h:59
@ FLAG_USED_BY_VERTEX_LOD3
Definition MDL.h:70
@ FLAG_USED_BY_VERTEX_LOD5
Definition MDL.h:72
@ FLAG_USED_BY_ATTACHMENT
Definition MDL.h:66
@ FLAG_ALWAYS_PROCEDURAL
Definition MDL.h:61
@ FLAG_TYPE_MASK
Definition MDL.h:83
@ FLAG_USED_BY_VERTEX_LOD4
Definition MDL.h:71
@ FLAG_USED_BY_VERTEX_LOD1
Definition MDL.h:68
@ FLAG_SCREEN_ALIGN_CYLINDER
Definition MDL.h:63
@ FLAG_USED_BY_VERTEX_LOD0
Definition MDL.h:67
@ FLAG_USED_BY_VERTEX_MASK
Definition MDL.h:76
@ FLAG_HAS_SAVEFRAME_ROT
Definition MDL.h:81
@ FLAG_CALCULATE_MASK
Definition MDL.h:64
@ FLAG_USED_BY_VERTEX_LOD2
Definition MDL.h:69
@ FLAG_USED_BY_HITBOX
Definition MDL.h:65
@ FLAG_USED_BY_VERTEX_LOD6
Definition MDL.h:73
@ FLAG_USED_MASK
Definition MDL.h:77
@ FLAG_HAS_SAVEFRAME_POS
Definition MDL.h:80
sourcepp::math::Vec3f rotationScale
Definition MDL.h:95
int32_t procType
Definition MDL.h:99
int32_t procIndex
Definition MDL.h:100
std::string name
Definition MDL.h:87
Flags flags
Definition MDL.h:98
std::array< int32_t, 6 > boneController
Definition MDL.h:90
int32_t physicsBone
Definition MDL.h:101
sourcepp::math::Mat3x4f poseToBose
Definition MDL.h:96
int32_t parent
Definition MDL.h:89
std::string surfacePropName
Definition MDL.h:104
int32_t contents
Definition MDL.h:106
std::vector< AnimValue > animValues
Definition MDL.h:168
sourcepp::math::Vec< 6, int16_t > offset
Definition MDL.h:167
sourcepp::math::Vec< 6, float > scale
Definition MDL.h:166
std::string eventName
Definition MDL.h:295
int32_t type
Definition MDL.h:289
std::string options
Definition MDL.h:292
float cycle
Definition MDL.h:287
int32_t event
Definition MDL.h:288
int32_t upperLidFlexDesc
Definition MDL.h:434
int32_t bone
Definition MDL.h:417
std::array< float, 3 > lowerTarget
Definition MDL.h:432
int32_t texture
Definition MDL.h:423
std::array< float, 3 > upperTarget
Definition MDL.h:431
int32_t lowerLidFlexDesc
Definition MDL.h:435
sourcepp::math::Vec3f org
Definition MDL.h:418
sourcepp::math::Vec3f forward
Definition MDL.h:422
std::array< int32_t, 3 > lowerFlexDesc
Definition MDL.h:430
std::array< int32_t, 3 > upperFlexDesc
Definition MDL.h:429
std::string name
Definition MDL.h:415
float irisScale
Definition MDL.h:426
sourcepp::math::Vec3f up
Definition MDL.h:421
std::string controllerName0
Definition MDL.h:671
std::string controllerName1
Definition MDL.h:672
std::string controllerName2
Definition MDL.h:673
int32_t op
Definition MDL.h:595
int32_t index
Definition MDL.h:597
union mdlpp::MDL::FlexOp::@245166217224321047226174167162074201164112137371 d
std::vector< FlexOp > ops
Definition MDL.h:607
std::string name
Definition MDL.h:126
std::vector< BBox > hitboxes
Definition MDL.h:130
std::vector< IKLink > links
Definition MDL.h:625
std::string name
Definition MDL.h:619
int32_t linkType
Definition MDL.h:621
sourcepp::math::Vec3f position
Definition MDL.h:161
sourcepp::math::Quat rotation
Definition MDL.h:162
int32_t bone
Definition MDL.h:175
std::optional< CompressedIKError > compressedIKError
Definition MDL.h:184
std::string attachment
Definition MDL.h:206
int32_t type
Definition MDL.h:173
float contact
Definition MDL.h:197
int32_t chain
Definition MDL.h:174
int32_t slot
Definition MDL.h:176
sourcepp::math::Quat q
Definition MDL.h:181
int32_t index
Definition MDL.h:172
std::vector< IKError > ikErrors
Definition MDL.h:190
sourcepp::math::Vec3f pos
Definition MDL.h:180
int32_t iStart
Definition MDL.h:188
std::string name
Definition MDL.h:652
std::string label
Definition MDL.h:649
std::vector< int32_t > flags
Definition MDL.h:27
std::vector< int32_t > parent
Definition MDL.h:28
std::vector< sourcepp::math::Quat > quaternion
Definition MDL.h:30
int32_t boneCount
Definition MDL.h:25
std::vector< sourcepp::math::Vec3f > positionScale
Definition MDL.h:33
std::vector< sourcepp::math::Vec3f > rotation
Definition MDL.h:31
std::vector< sourcepp::math::Vec3f > rotationScale
Definition MDL.h:34
std::vector< sourcepp::math::Mat3x4f > poseToBone
Definition MDL.h:32
std::vector< sourcepp::math::Vec3f > position
Definition MDL.h:29
std::vector< sourcepp::math::Quat > quaternionAlignment
Definition MDL.h:35
std::optional< CompressedIKError > compressedIKError
Definition MDL.h:221
int32_t illumPositionAttachmentIndex
Definition MDL.h:851
int32_t linearBoneIndex
Definition MDL.h:853
int32_t srcBoneTransformIndex
Definition MDL.h:850
int32_t srcBoneTransformCount
Definition MDL.h:849
int32_t boneFlexDriverIndex
Definition MDL.h:856
int32_t boneFlexDriverCount
Definition MDL.h:855
std::vector< PoseParameter > poseParameters
Definition MDL.h:794
sourcepp::math::Vec3f viewBBoxMax
Definition MDL.h:718
std::vector< FlexRule > flexRules
Definition MDL.h:782
sourcepp::math::Vec3f hullMax
Definition MDL.h:716
uint8_t directionalDotProduct
Definition MDL.h:830
std::vector< Material > materials
Definition MDL.h:747
std::vector< std::string > localNodeNames
Definition MDL.h:769
std::vector< AnimDesc > animations
Definition MDL.h:736
int32_t activityListVersion
Definition MDL.h:742
std::vector< Mouth > mouths
Definition MDL.h:790
Flags flags
Definition MDL.h:720
bool open(const std::byte *data, std::size_t size)
Definition MDL.cpp:51
@ FLAG_BUILT_IN_PREVIEW_MODE
Definition MDL.h:697
@ FLAG_FORCE_PHONEME_CROSSFADE
Definition MDL.h:694
@ FLAG_VERT_ANIM_FIXED_POINT_SCALE
Definition MDL.h:701
@ FLAG_STATIC_PROP
Definition MDL.h:689
@ FLAG_OBSOLETE
Definition MDL.h:692
@ FLAG_AUTOGENERATED_HITBOX
Definition MDL.h:686
@ FLAG_FLEXES_CONVERTED
Definition MDL.h:696
@ FLAG_TRANSLUCENT_TWO_PASS
Definition MDL.h:688
@ FLAG_CONSTANT_DIRECTIONAL_LIGHT_DOT
Definition MDL.h:695
@ FLAG_DO_NOT_CAST_SHADOWS
Definition MDL.h:698
@ FLAG_EXTRA_VERTEX_DATA
Definition MDL.h:702
@ FLAG_NO_FORCED_FADE
Definition MDL.h:693
@ FLAG_CAST_TEXTURE_SHADOWS
Definition MDL.h:699
@ FLAG_SUBDIVISION_SURFACE
Definition MDL.h:700
@ FLAG_FORCE_OPAQUE
Definition MDL.h:687
@ FLAG_HAS_SHADOW_LOD
Definition MDL.h:690
@ FLAG_USE_SHADOW_LOD_MATERIALS
Definition MDL.h:691
bool hasHeader2
Definition MDL.h:860
std::vector< std::string > flexDescs
Definition MDL.h:774
std::string name
Definition MDL.h:710
std::string keyValues
Definition MDL.h:801
std::vector< IKChain > ikChains
Definition MDL.h:786
std::vector< Attachment > attachments
Definition MDL.h:764
sourcepp::math::Vec3f viewBBoxMin
Definition MDL.h:717
sourcepp::math::Vec3f eyePosition
Definition MDL.h:713
int32_t studioHdr2Index
Definition MDL.h:844
std::vector< FlexControllerUI > flexControllerUIs
Definition MDL.h:839
std::vector< SequenceDesc > sequences
Definition MDL.h:740
sourcepp::math::Vec3f hullMin
Definition MDL.h:715
std::vector< std::vector< int16_t > > skins
Definition MDL.h:756
std::vector< std::string > materialDirectories
Definition MDL.h:751
int32_t checksum
Definition MDL.h:707
std::string surfaceProperty
Definition MDL.h:797
uint8_t rootLOD
Definition MDL.h:831
std::vector< IncludeModel > includeModels
Definition MDL.h:812
std::vector< uint8_t > boneTableByName
Definition MDL.h:825
std::vector< SrcBoneTransform > srcBoneTransforms
Definition MDL.h:862
sourcepp::math::Vec3f illuminationPosition
Definition MDL.h:714
std::vector< BodyPart > bodyParts
Definition MDL.h:760
std::vector< BoneFlexDriver > boneFlexDrivers
Definition MDL.h:864
uint8_t numAllowedRootLODs
Definition MDL.h:832
std::vector< AnimBlock > animationBlocks
Definition MDL.h:820
std::vector< BoneController > boneControllers
Definition MDL.h:728
std::vector< uint8_t > localNodeTransitions
Definition MDL.h:770
std::vector< FlexController > flexControllers
Definition MDL.h:778
std::vector< Bone > bones
Definition MDL.h:724
std::optional< LinearBone > linearBone
Definition MDL.h:863
std::string animationBlocksName
Definition MDL.h:819
float mass
Definition MDL.h:807
int32_t eventsIndexed
Definition MDL.h:743
int32_t contentsFlags
Definition MDL.h:808
Header2 header2
Definition MDL.h:859
int32_t version
Definition MDL.h:706
std::vector< HitboxSet > hitboxSets
Definition MDL.h:732
float vertAnimFixedPointScale
Definition MDL.h:841
std::vector< IKLock > ikAutoplayLocks
Definition MDL.h:805
@ FLAG_RELATIVE_TEXTURE_PATH_SPECIFIED
Definition MDL.h:397
std::string name
Definition MDL.h:403
std::vector< VertexAnim > vertAnims
Definition MDL.h:474
int32_t flexDescIndex
Definition MDL.h:464
std::vector< VertexAnimWrinkle > vertAnimsWrinkle
Definition MDL.h:475
int32_t flexPair
Definition MDL.h:477
uint8_t vertAnimType
Definition MDL.h:478
int32_t materialParam
Definition MDL.h:497
std::vector< MeshFlex > flexes
Definition MDL.h:494
sourcepp::math::Vec3f center
Definition MDL.h:501
int32_t material
Definition MDL.h:484
int32_t modelVertexData
Definition MDL.h:503
int32_t meshID
Definition MDL.h:499
std::array< int32_t, MAX_LOD_COUNT > numLODVertexes
Definition MDL.h:504
int32_t materialType
Definition MDL.h:496
int32_t verticesCount
Definition MDL.h:489
int32_t verticesOffset
Definition MDL.h:490
std::vector< Attachment > attachments
Definition MDL.h:538
int32_t verticesCount
Definition MDL.h:532
float boundingRadius
Definition MDL.h:525
int32_t verticesOffset
Definition MDL.h:533
std::vector< Eyeball > eyeballs
Definition MDL.h:542
std::vector< Mesh > meshes
Definition MDL.h:529
int32_t type
Definition MDL.h:523
std::string name
Definition MDL.h:521
int32_t tangentsOffset
Definition MDL.h:534
sourcepp::math::Vec3f forward
Definition MDL.h:631
int32_t flexDescIndex
Definition MDL.h:632
int32_t bone
Definition MDL.h:630
std::string name
Definition MDL.h:638
float paramStart[2]
Definition MDL.h:343
std::string activityName
Definition MDL.h:320
int32_t paramIndex[2]
Definition MDL.h:342
std::vector< std::string > activityModifiers
Definition MDL.h:387
int32_t localEntryNode
Definition MDL.h:350
int32_t localExitNode
Definition MDL.h:351
std::vector< Event > events
Definition MDL.h:329
std::vector< IKLock > ikLocks
Definition MDL.h:377
sourcepp::math::Vec3f boundingBoxMin
Definition MDL.h:331
sourcepp::math::Vec3f boundingBoxMax
Definition MDL.h:332
std::vector< float > boneWeights
Definition MDL.h:370
std::vector< AutoLayer > autoLayers
Definition MDL.h:367
int32_t cyclePoseIndex
Definition MDL.h:383
std::string label
Definition MDL.h:317
int32_t activityWeight
Definition MDL.h:325
int32_t movementIndex
Definition MDL.h:339
int32_t groupSize[2]
Definition MDL.h:341
std::string keyValues
Definition MDL.h:381
std::vector< int16_t > animIndices
Definition MDL.h:337
std::vector< float > poseKeys
Definition MDL.h:373
sourcepp::math::Mat3x4f pretransform
Definition MDL.h:20
sourcepp::math::Mat3x4f posttransform
Definition MDL.h:21
std::array< int16_t, 3 > delta
Definition MDL.h:458
std::array< int16_t, 3 > ndelta
Definition MDL.h:459
std::array< int16_t, 3 > ndelta
Definition MDL.h:451
std::array< int16_t, 3 > delta
Definition MDL.h:448