Archived
1
Fork 0
This repository has been archived on 2025-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
libxiv/include/mdlparser.h
Joshua Goins 071aed6596 Export bone weights & bone ids for vertices
This currently pulls in glm as a dependency, will be added to the build
system soon.
2022-04-28 17:47:48 -04:00

40 lines
No EOL
696 B
C++

#pragma once
#include <string_view>
#include <vector>
#include <array>
#include "memorybuffer.h"
struct Vertex {
std::array<float, 3> position;
std::array<float, 2> uv;
std::array<float, 3> normal;
std::array<float, 4> boneWeights;
std::array<uint8_t, 4> boneIds;
};
struct PartSubmesh {
uint32_t indexOffset, indexCount;
uint32_t boneStartIndex, boneCount;
};
struct Part {
std::vector<Vertex> vertices;
std::vector<uint16_t> indices;
std::vector<PartSubmesh> submeshes;
};
struct Lod {
std::vector<Part> parts;
};
struct Model {
std::vector<Lod> lods;
std::vector<std::string> affectedBoneNames;
};
Model parseMDL(MemorySpan data);