diff options
| author | RunitaiLinden <davep@lindenlab.com> | 2024-04-30 21:57:42 -0500 |
|---|---|---|
| committer | RunitaiLinden <davep@lindenlab.com> | 2024-04-30 21:57:42 -0500 |
| commit | 170765fd3505410dced83b342f87030fd9151e35 (patch) | |
| tree | f3665586f2d731a04bf645bc1155bbddc6c5f7e8 /indra/newview/gltf/accessor.cpp | |
| parent | 5e2bac01cb6e8d3de3cc0e496d94a729e4740247 (diff) | |
#1357 Proof of concept on decomposing a GLTF scene into its component parts
Diffstat (limited to 'indra/newview/gltf/accessor.cpp')
| -rw-r--r-- | indra/newview/gltf/accessor.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp index 55d36b7a32..9bfdc2afa6 100644 --- a/indra/newview/gltf/accessor.cpp +++ b/indra/newview/gltf/accessor.cpp @@ -30,6 +30,24 @@ using namespace LL::GLTF; +void Buffer::erase(Asset& asset, S32 offset, S32 length) +{ + S32 idx = this - &asset.mBuffers[0]; + + mData.erase(mData.begin() + offset, mData.begin() + offset + length); + + for (BufferView& view : asset.mBufferViews) + { + if (view.mBuffer == idx) + { + if (view.mByteOffset >= offset) + { + view.mByteOffset -= length; + } + } + } +} + const Buffer& Buffer::operator=(const tinygltf::Buffer& src) { mData = src.data; |
