Animation WIP merge #321

Merged
XiaoQiDigipen merged 76 commits from SP3-17-animation-system into main 2023-01-30 17:35:57 +08:00
2 changed files with 28 additions and 0 deletions
Showing only changes of commit 7f9991038a - Show all commits

Binary file not shown.

View File

@ -222,6 +222,34 @@ namespace SHADE
file.read(reinterpret_cast<char*>(data.VertexNormals.data()), vertexVec3Byte);
file.read(reinterpret_cast<char*>(data.VertexTexCoords.data()), vertexVec2Byte);
file.read(reinterpret_cast<char*>(data.Indices.data()), sizeof(uint32_t) * header.indexCount);
std::vector<MeshBoneInfo> boneInfos(header.boneCount);
std::vector<MeshBone> bones(header.boneCount);
file.read(reinterpret_cast<char*>(boneInfos.data()), sizeof(MeshBoneInfo) * header.boneCount);
for (auto i{ 0 }; i < header.boneCount; ++i)
{
auto& bone = bones[i];
auto const& info = boneInfos[i];
bone.name.resize(info.charCount);
file.read(bone.name.data(), info.charCount);
file.read(reinterpret_cast<char*>(&bone.offset), sizeof(SHMatrix));
uint32_t weightCount;
file.read(reinterpret_cast<char*>(&weightCount), sizeof(uint32_t));
bone.weights.resize(weightCount);
file.read(reinterpret_cast<char*>(bone.weights.data()), sizeof(BoneWeight) * weightCount);
}
data.VertexBoneIndices.resize(header.vertexCount);
data.VertexBoneWeights.resize(header.vertexCount);
for (auto const& bone : bones)
{
}
meshes[i] = &data;
}