MDLParser
Simple and modern library for parsing the Source engine model formats
Loading...
Searching...
No Matches
vvd.hpp
1#pragma once
2
3#include "common.hpp"
4#include "../limits.hpp"
5
6namespace MdlParser::Structs::Vvd {
7 using Limits::MAX_NUM_LODS;
8 using Limits::MAX_NUM_BONES_PER_VERT;
9
10#pragma pack(push, 1)
11
12 struct Header {
13 static constexpr int32_t SUPPORTED_VERSION = 4;
14
15 int32_t id;
16 int32_t version;
17 int32_t checksum;
18
19 int32_t numLoDs;
20 std::array<int32_t, MAX_NUM_LODS> numLoDVertices;
21
22 int32_t numFixups;
23 int32_t fixupTableOffset;
24
25 int32_t vertexDataOffset;
26 int32_t tangentDataOffset;
27 };
28
29 struct Fixup {
30 int32_t lod;
31 int32_t sourceVertexId;
32 int32_t numVertices;
33 };
34
35 struct BoneWeight {
36 std::array<float, MAX_NUM_BONES_PER_VERT> weight;
37 std::array<int8_t, MAX_NUM_BONES_PER_VERT> bone;
38 uint8_t numBones;
39 };
40
41 struct Vertex {
42 BoneWeight boneWeights;
43 Vector pos;
44 Vector normal;
45 Vector2D texCoord;
46 };
47
48#pragma pack(pop)
49}
Definition: common.hpp:6
Definition: common.hpp:10
Definition: vvd.hpp:29
Definition: vvd.hpp:12
Definition: vvd.hpp:41