Animation WIP merge #321
Binary file not shown.
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue