Skip to content

Commit

Permalink
Merge pull request #246 from Laupetin/fix/gltf-loading-buffer-view
Browse files Browse the repository at this point in the history
fix: gltf buffer view incorrectly calculating stride
  • Loading branch information
Laupetin authored Sep 6, 2024
2 parents e0b2807 + 30ca98d commit 149a24b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ObjLoading/XModel/Gltf/Internal/GltfBufferView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BufferView::BufferView(const Buffer* buffer, const size_t offset, const size_t l

bool BufferView::ReadElement(void* dest, const size_t elementIndex, const size_t elementSize, const size_t elementOffset) const
{
const auto stride = std::max(elementOffset + elementSize, m_stride);
const auto stride = std::max(elementSize, m_stride);
const auto bufferViewOffset = elementOffset + elementIndex * stride;
if (bufferViewOffset + elementSize > m_length)
return false;
Expand Down

0 comments on commit 149a24b

Please sign in to comment.