bugfix: Fixed the issue that draco compressed gltf files cannot be loaded normally (#5882) (#5883)

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit is contained in:
HandsomeXi
2024-12-04 22:03:57 +01:00
committed by GitHub
co-authored by Kim Kulling
parent ff61095928
commit 164a5ae8cf
3 changed files with 23 additions and 0 deletions
+2
View File
@@ -294,6 +294,8 @@ inline void SetDecodedIndexBuffer_Draco(const draco::Mesh &dracoMesh, Mesh::Prim
// Usually uint32_t but shouldn't assume
if (sizeof(dracoMesh.face(draco::FaceIndex(0))[0]) == componentBytes) {
memcpy(decodedIndexBuffer->GetPointer(), &dracoMesh.face(draco::FaceIndex(0))[0], decodedIndexBuffer->byteLength);
// Assign this alternate data buffer to the accessor
prim.indices->decodedBuffer.swap(decodedIndexBuffer);
return;
}