12 BufferStreamReadOnly stream{data, size};
14 if (stream.read<int32_t>() !=
VVD_ID) {
18 if (stream.read(this->version); this->version != 4) {
22 if (stream.read<int32_t>() != mdl.
checksum) {
30 const auto fixupsCount = stream.read<int32_t>();
31 const auto fixupsOffset = stream.read<int32_t>();
32 const auto verticesOffset = stream.read<int32_t>();
33 const auto tangentsOffset = stream.read<int32_t>();
35 stream.seek(verticesOffset);
37 auto& [boneWeight, position, normal, uv, tangent] = this->
vertices.emplace_back();
39 stream.read(boneWeight.weight);
41 std::array<int8_t, MAX_BONES_PER_VERTEX> bones{};
43 const auto boneCount = stream.read<int8_t>();
45 boneWeight.bones.push_back(bones[j]);
55 stream.seek(tangentsOffset);
56 for (std::size_t i = 0; i < this->numVerticesInLOD[0]; i++) {
57 this->
vertices.at(i).tangent = stream.read<math::Vec4f>();
60 stream.seek(fixupsOffset);
61 for (
int i = 0; i < fixupsCount; i++) {
62 auto& [LOD, sourceVertexID, vertexCount] = this->
fixups.emplace_back();
63 stream >> LOD >> sourceVertexID >> vertexCount;