2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-12 19:47:27 +00:00

Added support for unsigned int accessors (#245)

* Added Unsigned Int to CreateAccessors()

* Added UnsignedIntAccessor class

* Added UnsignedIntAccessor class function implementations

* Oops

* Update src/ObjLoading/XModel/Gltf/Internal/GltfAccessor.cpp

Co-authored-by: Jan <Laupetin@users.noreply.github.com>

* Fixed ReadElement() using incorrect elementSize

---------

Co-authored-by: Jan <Laupetin@users.noreply.github.com>
This commit is contained in:
Electro Games
2024-09-06 09:46:21 -05:00
committed by GitHub
parent 8bab112afe
commit e0b28075a6
3 changed files with 133 additions and 1 deletions

View File

@@ -650,6 +650,8 @@ namespace
m_accessors.emplace_back(std::make_unique<UnsignedByteAccessor>(bufferView, jAccessor.type, byteOffset, jAccessor.count));
else if (jAccessor.componentType == JsonAccessorComponentType::UNSIGNED_SHORT)
m_accessors.emplace_back(std::make_unique<UnsignedShortAccessor>(bufferView, jAccessor.type, byteOffset, jAccessor.count));
else if (jAccessor.componentType == JsonAccessorComponentType::UNSIGNED_INT)
m_accessors.emplace_back(std::make_unique<UnsignedIntAccessor>(bufferView, jAccessor.type, byteOffset, jAccessor.count));
else
throw GltfLoadException(std::format("Accessor has unsupported component type {}", static_cast<unsigned>(jAccessor.componentType)));
}