Merge pull request #4195 from ruyo/fix-gltf2-sparse-indicesType

Fixed an incorrect indeiciesType in the glTF2 sparse accessor.
pull/4207/head
Kim Kulling 2021-11-22 22:43:43 +01:00 committed by GitHub
commit 889e559696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -863,6 +863,9 @@ inline void Accessor::Read(Value &obj, Asset &r) {
//indices componentType
sparse->indicesType = MemberOrDefault(*indicesValue, "componentType", ComponentType_BYTE);
//sparse->indices->Read(*indicesValue, r);
} else {
// indicesType
sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT);
}
// value
@ -875,8 +878,6 @@ inline void Accessor::Read(Value &obj, Asset &r) {
//sparse->values->Read(*valuesValue, r);
}
// indicesType
sparse->indicesType = MemberOrDefault(*sparseValue, "componentType", ComponentType_UNSIGNED_SHORT);
const unsigned int elementSize = GetElementSize();
const size_t dataSize = count * elementSize;