Working commit
This commit is contained in:
parent
7ecb8b11ad
commit
7f9991038a
Binary file not shown.
|
@ -223,6 +223,34 @@ namespace SHADE
|
||||||
file.read(reinterpret_cast<char*>(data.VertexTexCoords.data()), vertexVec2Byte);
|
file.read(reinterpret_cast<char*>(data.VertexTexCoords.data()), vertexVec2Byte);
|
||||||
file.read(reinterpret_cast<char*>(data.Indices.data()), sizeof(uint32_t) * header.indexCount);
|
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;
|
meshes[i] = &data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue