mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
chore: properly calculate partbits for loaded gltf models
This commit is contained in:
parent
1be630f71e
commit
2687fbf9fd
@ -467,6 +467,13 @@ namespace
|
||||
memcpy(surface.triIndices, sortedTris.data(), sizeof(std::remove_pointer_t<decltype(XSurface::triIndices)>) * surface.triCount);
|
||||
}
|
||||
|
||||
static void AddBoneToXSurfacePartBits(XSurface& surface, const size_t boneIndex)
|
||||
{
|
||||
const auto partBitsIndex = boneIndex / 32u;
|
||||
const auto shiftValue = 31u - (boneIndex % 32u);
|
||||
surface.partBits[partBitsIndex] |= 1 << shiftValue;
|
||||
}
|
||||
|
||||
void CreateVertListData(XSurface& surface, const std::vector<size_t>& vertexIndices, const XModelCommon& common)
|
||||
{
|
||||
ReorderRigidTrisByBoneIndex(vertexIndices, surface, common);
|
||||
@ -504,6 +511,8 @@ namespace
|
||||
|
||||
currentVertexTail = currentVertexHead;
|
||||
currentTriTail = currentTriHead;
|
||||
|
||||
AddBoneToXSurfacePartBits(surface, boneIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user